You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a MySQL cluster managed by DBA, and migrating the DB manually.
I've discovered a potential issue in the code that could lead to one unintended DB migration.
I think Kratos and Ory ecosystem should provide an option to turn off this auto migration.
In this code, migration is performed whenever the application determines the network.
If multiple instances are deployed, migration will be attempted on all instances.
func (p*Persister) DetermineNetwork(ctx context.Context) (*networkx.Network, error) {
// migration is performed hereiferr:=p.p.MigrateUp(ctx); err!=nil {
returnnil, err
}
returnp.p.Determine(ctx)
}
Expected behavior
Provide an option to disable it.
The text was updated successfully, but these errors were encountered:
And if user use the in-memory type, kratos can migrate it on every start.
// if dsn is memory we have to run the migrations on every startifdbal.IsMemorySQLite(m.Config(ctx).DSN()) ||m.Config(ctx).DSN() ==dbal.SQLiteInMemory||m.Config(ctx).DSN() ==dbal.SQLiteSharedInMemory||m.Config(ctx).DSN() =="memory" {
m.Logger().Infoln("Ory Kratos is running migrations on every startup as DSN is memory. This means your data is lost when Kratos terminates.")
iferr:=p.MigrateUp(ctx); err!=nil {
m.Logger().WithError(err).Warnf("Unable to run migrations, retrying.")
returnerr
}
}
Describe the bug
I am using a MySQL cluster managed by DBA, and migrating the DB manually.
I've discovered a potential issue in the code that could lead to one unintended DB migration.
I think Kratos and Ory ecosystem should provide an option to turn off this auto migration.
kratos/driver/registry_default.go
Line 510 in 4e2b1fe
kratos/persistence/sql/persister.go
Line 75 in 4e2b1fe
In this code, migration is performed whenever the application determines the network.
If multiple instances are deployed, migration will be attempted on all instances.
Expected behavior
Provide an option to disable it.
The text was updated successfully, but these errors were encountered: