@mikro-orm/knex 6.0.2-dev.9 → 6.0.3-dev.0

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.2-dev.9",
3
+ "version": "6.0.3-dev.0",
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",
@@ -63,9 +63,9 @@
63
63
  "sqlstring": "2.3.3"
64
64
  },
65
65
  "devDependencies": {
66
- "@mikro-orm/core": "^6.0.1"
66
+ "@mikro-orm/core": "^6.0.2"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.0.2-dev.9"
69
+ "@mikro-orm/core": "6.0.3-dev.0"
70
70
  }
71
71
  }
@@ -153,7 +153,7 @@ class DatabaseTable {
153
153
  }
154
154
  getEntityDeclaration(namingStrategy, schemaHelper, scalarPropertiesForRelations) {
155
155
  const { fksOnColumnProps, fksOnStandaloneProps, columnFks, fkIndexes, nullableForeignKeys, skippedColumnNames, } = this.foreignKeysToProps(namingStrategy, scalarPropertiesForRelations);
156
- let name = namingStrategy.getClassName(this.name, '_');
156
+ let name = namingStrategy.getEntityName(this.name, this.schema);
157
157
  name = name.match(/^\d/) ? 'E' + name : name;
158
158
  const schema = new core_1.EntitySchema({ name, collection: this.name, schema: this.schema });
159
159
  const compositeFkIndexes = {};
@@ -561,7 +561,7 @@ class DatabaseTable {
561
561
  }
562
562
  getPropertyTypeForForeignKey(namingStrategy, fk) {
563
563
  const parts = fk.referencedTableName.split('.', 2);
564
- return namingStrategy.getClassName(parts.length > 1 ? parts[1] : parts[0], '_');
564
+ return namingStrategy.getEntityName(...parts.reverse());
565
565
  }
566
566
  getPropertyTypeForColumn(namingStrategy, column, fk) {
567
567
  if (fk) {