@mikro-orm/knex 6.0.0-dev.318 → 6.0.0-dev.319

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.0.0-dev.318",
3
+ "version": "6.0.0-dev.319",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -66,6 +66,6 @@
66
66
  "@mikro-orm/core": "^5.0.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.0.0-dev.318"
69
+ "@mikro-orm/core": "6.0.0-dev.319"
70
70
  }
71
71
  }
@@ -27,11 +27,14 @@ class SqlSchemaGenerator extends core_1.AbstractSchemaGenerator {
27
27
  const exists = await this.helper.databaseExists(this.connection, dbName);
28
28
  this.lastEnsuredDatabase = dbName;
29
29
  if (!exists) {
30
- this.config.set('dbName', this.helper.getManagementDbName());
31
- await this.driver.reconnect();
32
- await this.createDatabase(dbName);
33
- this.config.set('dbName', dbName);
34
- await this.driver.reconnect();
30
+ const managementDbName = this.helper.getManagementDbName();
31
+ if (managementDbName) {
32
+ this.config.set('dbName', managementDbName);
33
+ await this.driver.reconnect();
34
+ await this.createDatabase(dbName);
35
+ this.config.set('dbName', dbName);
36
+ await this.driver.reconnect();
37
+ }
35
38
  if (options?.create) {
36
39
  await this.createSchema(options);
37
40
  }