Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: use environment table to determine schema initialization (#5449)
Danny Xua8d58e0f6de9
diff --git a/backend/migrator/migrator.go b/backend/migrator/migrator.goindex 2da3e571c9..a75c05ec2d 100644--- a/backend/migrator/migrator.go+++ b/backend/migrator/migrator.go@@ -204,10 +204,10 @@ func backfillHistory(ctx context.Context, storeInstance *store.Store, bytebasePg}func initializeSchema(ctx context.Context, storeInstance *store.Store, metadataDriver dbdriver.Driver, cutoffSchemaVersion semver.Version, serverVersion string) error {- // We use instance_change_history table to determine whether we've initialized the schema.+ // We use environment table to determine whether we've initialized the schema.var exists boolif err := metadataDriver.GetDB().QueryRowContext(ctx,- `SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'instance_change_history')`,+ `SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'environment')`,).Scan(&exists); err != nil {return err}