@mikro-orm/entity-generator 6.3.5-dev.16 → 6.3.5-dev.18
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/SourceFile.js +11 -5
- package/package.json +3 -3
package/SourceFile.js
CHANGED
|
@@ -528,11 +528,17 @@ class SourceFile {
|
|
|
528
528
|
const columnTypeFromMappedRuntimeType = mappedRuntimeType.getColumnType({ ...prop, autoincrement: false }, this.platform);
|
|
529
529
|
const columnTypeFromMappedColumnType = mappedColumnType.getColumnType({ ...prop, autoincrement: false }, this.platform);
|
|
530
530
|
const columnTypeFromMappedDeclaredType = mappedDeclaredType.getColumnType({ ...prop, autoincrement: false }, this.platform);
|
|
531
|
-
|
|
532
|
-
||
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
531
|
+
const needsExplicitColumnType = () => {
|
|
532
|
+
if (isTypeStringMissingFromMap || [mappedRuntimeType, mappedColumnType, columnTypeFromMappedDeclaredType].some(t => t instanceof core_1.UnknownType)) {
|
|
533
|
+
return true;
|
|
534
|
+
}
|
|
535
|
+
if (this.platform.normalizeColumnType(prop.columnTypes[0], prop) !== this.platform.normalizeColumnType(columnTypeFromMappedColumnType, prop)) {
|
|
536
|
+
return prop.columnTypes[0] !== columnTypeFromMappedColumnType;
|
|
537
|
+
}
|
|
538
|
+
return columnTypeFromMappedRuntimeType !== columnTypeFromMappedColumnType || columnTypeFromMappedDeclaredType !== columnTypeFromMappedColumnType;
|
|
539
|
+
};
|
|
540
|
+
if (needsExplicitColumnType()) {
|
|
541
|
+
options.columnType = this.quote(prop.columnTypes[0]);
|
|
536
542
|
}
|
|
537
543
|
const assign = (key) => {
|
|
538
544
|
if (prop[key] != null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/entity-generator",
|
|
3
|
-
"version": "6.3.5-dev.
|
|
3
|
+
"version": "6.3.5-dev.18",
|
|
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",
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@mikro-orm/knex": "6.3.5-dev.
|
|
61
|
+
"@mikro-orm/knex": "6.3.5-dev.18",
|
|
62
62
|
"fs-extra": "11.2.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@mikro-orm/core": "^6.3.4"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@mikro-orm/core": "6.3.5-dev.
|
|
68
|
+
"@mikro-orm/core": "6.3.5-dev.18"
|
|
69
69
|
}
|
|
70
70
|
}
|