@mikro-orm/knex 6.3.5-dev.13 → 6.3.5-dev.15
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/README.md +1 -1
- package/package.json +2 -2
- package/schema/DatabaseTable.js +7 -4
package/README.md
CHANGED
|
@@ -143,7 +143,7 @@ There is also auto-generated [CHANGELOG.md](CHANGELOG.md) file based on commit m
|
|
|
143
143
|
- [Using `QueryBuilder`](https://mikro-orm.io/docs/query-builder)
|
|
144
144
|
- [Preloading Deeply Nested Structures via populate](https://mikro-orm.io/docs/nested-populate)
|
|
145
145
|
- [Property Validation](https://mikro-orm.io/docs/property-validation)
|
|
146
|
-
- [Lifecycle Hooks](https://mikro-orm.io/docs/
|
|
146
|
+
- [Lifecycle Hooks](https://mikro-orm.io/docs/events#hooks)
|
|
147
147
|
- [Vanilla JS Support](https://mikro-orm.io/docs/usage-with-js)
|
|
148
148
|
- [Schema Generator](https://mikro-orm.io/docs/schema-generator)
|
|
149
149
|
- [Entity Generator](https://mikro-orm.io/docs/entity-generator)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.3.5-dev.
|
|
3
|
+
"version": "6.3.5-dev.15",
|
|
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,7 +66,7 @@
|
|
|
66
66
|
"@mikro-orm/core": "^6.3.4"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.3.5-dev.
|
|
69
|
+
"@mikro-orm/core": "6.3.5-dev.15",
|
|
70
70
|
"better-sqlite3": "*",
|
|
71
71
|
"libsql": "*",
|
|
72
72
|
"mariadb": "*"
|
package/schema/DatabaseTable.js
CHANGED
|
@@ -591,6 +591,11 @@ class DatabaseTable {
|
|
|
591
591
|
const unique = compositeFkUniques[prop] || this.indexes.find(idx => idx.columnNames[0] === column.name && !idx.composite && idx.unique && !idx.primary);
|
|
592
592
|
const kind = this.getReferenceKind(fk, unique);
|
|
593
593
|
const runtimeType = this.getPropertyTypeForColumn(namingStrategy, column, fk);
|
|
594
|
+
const type = fk ? runtimeType : (core_1.Utils.keys(core_1.t).find(k => {
|
|
595
|
+
const typeInCoreMap = this.platform.getMappedType(k);
|
|
596
|
+
return (typeInCoreMap !== core_1.Type.getType(core_1.UnknownType) || k === 'unknown') && typeInCoreMap === column.mappedType;
|
|
597
|
+
}) ?? runtimeType);
|
|
598
|
+
const ignoreSchemaChanges = (type === 'unknown' && column.length) ? (column.extra ? ['type', 'extra'] : ['type']) : undefined;
|
|
594
599
|
const defaultRaw = this.getPropertyDefaultValue(schemaHelper, column, runtimeType, true);
|
|
595
600
|
const defaultParsed = this.getPropertyDefaultValue(schemaHelper, column, runtimeType);
|
|
596
601
|
const defaultTs = defaultRaw !== defaultParsed ? defaultParsed : undefined;
|
|
@@ -605,12 +610,10 @@ class DatabaseTable {
|
|
|
605
610
|
}
|
|
606
611
|
return {
|
|
607
612
|
name: prop,
|
|
608
|
-
type
|
|
609
|
-
const typeInCoreMap = this.platform.getMappedType(k);
|
|
610
|
-
return (typeInCoreMap !== core_1.Type.getType(core_1.UnknownType) || k === 'unknown') && typeInCoreMap === column.mappedType;
|
|
611
|
-
}) ?? runtimeType),
|
|
613
|
+
type,
|
|
612
614
|
runtimeType,
|
|
613
615
|
kind,
|
|
616
|
+
ignoreSchemaChanges,
|
|
614
617
|
generated: column.generated,
|
|
615
618
|
optional: defaultRaw !== 'null' || defaultTs != null || typeof column.generated !== 'undefined',
|
|
616
619
|
columnType: column.type,
|