| 59 | if t.SchemaName == schemaName { |
| 60 | return configstore.ErrOrgTeamSchemaConflict |
| 61 | } |
| 62 | } |
| 63 | clone := copyOrg(org) |
| 64 | clone.Warehouse = nil |
| 65 | s.orgs[org.Name] = clone |
| 66 | s.seedTeam(configstore.OrgTeam{OrgID: org.Name, TeamID: teamID, SchemaName: schemaName, Enabled: true}) |
| 67 | return nil |
| 68 | } |
| 69 | |
| 70 | func (s *fakeAPIStore) GetOrg(name string) (*configstore.Org, error) { |
| 71 | org, ok := s.orgs[name] |
| 72 | if !ok { |
| 73 | return nil, gorm.ErrRecordNotFound |
| 74 | } |
| 75 | return copyOrg(org), nil |
| 76 | } |
| 77 | |
| 78 | func (s *fakeAPIStore) UpdateOrg(name string, updates configstore.Org) (*configstore.Org, bool, error) { |
| 79 | org, ok := s.orgs[name] |
| 80 | if !ok { |
| 81 | return nil, false, nil |
| 82 | } |
| 83 | org.MaxWorkers = updates.MaxWorkers |
| 84 | org.MaxVCPUs = updates.MaxVCPUs |
| 85 | // Mirrors gormAPIStore: "" = preserve, non-empty renames. |
| 86 | if updates.DatabaseName != "" { |