feat(config): add config ensure_default_org_and_user (#107619)

This commit is contained in:
Jean-Philippe Quéméner
2025-07-04 17:19:53 +02:00
committed by GitHub
parent cc2eac7f84
commit 3abe84121f
3 changed files with 27 additions and 32 deletions
+5 -1
View File
@@ -174,8 +174,12 @@ func NewTestStore(tb TestingTB, opts ...TestOption) *SQLStore {
engine.DatabaseTZ = time.UTC
engine.TZLocation = time.UTC
cfgDBSec := cfg.Raw.Section("database")
shouldEnsure := fmt.Sprintf("%t", !options.NoDefaultUserOrg && !options.Truncate)
cfgDBSec.Key("ensure_default_org_and_user").SetValue(shouldEnsure)
store, err := newStore(cfg, engine, features, options.MigratorFactory(features),
options.Bus, options.Tracer, options.NoDefaultUserOrg || options.Truncate)
options.Bus, options.Tracer)
if err != nil {
tb.Fatalf("failed to create a new SQLStore: %v", err)
panic("unreachable")