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
When the migration:fresh command is run with drop-db, the database is dropped correctly but then the migrations are run against the 'postgres' db rather that the db specified in the config.
Reproduction
When generate.dropSchema is executed with 'dropDb: true' Mikro connects to the 'postgres' db to run the drop command command but then never switches back to the user provided dbName.
privatestaticasynchandleFreshCommand(args: ArgumentsCamelCase<Opts>,migrator: IMigrator,orm: MikroORM){console.log(orm.config.get('dbName'));// dbName is correctawaitgenerator.dropSchema({dropMigrationsTable: true,dropDb: args.dropDb});console.log(orm.config.get('dbName'));// dbName is now 'postgres' - migrations run against 'postgres' db rather than the original db
Describe the bug
When the migration:fresh command is run with
drop-db
, the database is dropped correctly but then the migrations are run against the 'postgres' db rather that the db specified in the config.Reproduction
When
generate.dropSchema
is executed with 'dropDb: true' Mikro connects to the 'postgres' db to run the drop command command but then never switches back to the user provided dbName.What driver are you using?
@mikro-orm/postgresql
MikroORM version
6.2.6
Node.js version
20.9.0
Operating system
macOS
Validations
The text was updated successfully, but these errors were encountered: