Correlations: Add organization id (#72258)
* Add org_id to correlations * Add tests * Allow org_id to be null in case org_id=0 is used * Create organization to ensure stable id is generated * Fix linting * Ensure backwards compatibility * Add deprecation information * Migrate correlations indices * Default org_id when migrating * Remove redundant default * Make PK non-nullable
This commit is contained in:
@@ -134,6 +134,18 @@ func (c TestContext) getURL(url string, user User) string {
|
||||
)
|
||||
}
|
||||
|
||||
func (c TestContext) createOrg(name string) int64 {
|
||||
c.t.Helper()
|
||||
store := c.env.SQLStore
|
||||
store.Cfg.AutoAssignOrg = false
|
||||
quotaService := quotaimpl.ProvideService(store, store.Cfg)
|
||||
orgService, err := orgimpl.ProvideService(store, store.Cfg, quotaService)
|
||||
require.NoError(c.t, err)
|
||||
orgId, err := orgService.GetOrCreate(context.Background(), name)
|
||||
require.NoError(c.t, err)
|
||||
return orgId
|
||||
}
|
||||
|
||||
func (c TestContext) createUser(cmd user.CreateUserCommand) User {
|
||||
c.t.Helper()
|
||||
store := c.env.SQLStore
|
||||
|
||||
Reference in New Issue
Block a user