@mikro-orm/sql 7.1.6-dev.13 → 7.1.6-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/package.json +2 -2
- package/schema/DatabaseSchema.js +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/sql",
|
|
3
|
-
"version": "7.1.6-dev.
|
|
3
|
+
"version": "7.1.6-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
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@mikro-orm/core": "^7.1.5"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.1.6-dev.
|
|
56
|
+
"@mikro-orm/core": "7.1.6-dev.15"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|
package/schema/DatabaseSchema.js
CHANGED
|
@@ -230,6 +230,12 @@ export class DatabaseSchema {
|
|
|
230
230
|
table.addIndex(meta, { properties: pkPropsForIndex.map(prop => prop.name) }, 'primary');
|
|
231
231
|
for (const check of meta.checks) {
|
|
232
232
|
const columnName = check.property ? meta.properties[check.property].fieldNames[0] : undefined;
|
|
233
|
+
// In TPT, inherited columns live on the parent table only, so a check
|
|
234
|
+
// that references such a column must not be emitted onto the child
|
|
235
|
+
// table, where that column does not exist.
|
|
236
|
+
if (meta.inheritanceType === 'tpt' && meta.tptParent && columnName && !table.hasColumn(columnName)) {
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
233
239
|
const expression = isRaw(check.expression)
|
|
234
240
|
? platform.formatQuery(check.expression.sql, check.expression.params)
|
|
235
241
|
: check.expression;
|