@mikro-orm/sql 7.1.11-dev.5 → 7.1.11-dev.6
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/DatabaseTable.js +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/sql",
|
|
3
|
-
"version": "7.1.11-dev.
|
|
3
|
+
"version": "7.1.11-dev.6",
|
|
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.10"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.1.11-dev.
|
|
56
|
+
"@mikro-orm/core": "7.1.11-dev.6"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|
package/schema/DatabaseTable.js
CHANGED
|
@@ -300,6 +300,19 @@ export class DatabaseTable {
|
|
|
300
300
|
}
|
|
301
301
|
schema.addIndex(ret);
|
|
302
302
|
}
|
|
303
|
+
for (const check of this.getChecks()) {
|
|
304
|
+
// skip checks that were consumed by enum conversion — the enum property recreates an
|
|
305
|
+
// equivalent check under the conventional name during discovery (only on platforms that
|
|
306
|
+
// emulate enums via check constraints; mysql/mariadb enums are native and recreate nothing)
|
|
307
|
+
const enumItems = check.columnName ? this.getColumn(check.columnName)?.enumItems : undefined;
|
|
308
|
+
if (this.#platform.usesEnumCheckConstraints() &&
|
|
309
|
+
enumItems?.length &&
|
|
310
|
+
(check.expression === this.#platform.getEnumCheckConstraintExpression(check.columnName, enumItems) ||
|
|
311
|
+
check.name === this.#platform.getIndexName(this.name, [check.columnName], 'check'))) {
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
schema.meta.checks.push({ name: check.name, expression: check.expression });
|
|
315
|
+
}
|
|
303
316
|
const addedStandaloneFkPropsBasedOnColumn = new Set();
|
|
304
317
|
const nonSkippedColumns = this.getColumns().filter(column => !skippedColumnNames.includes(column.name));
|
|
305
318
|
for (const column of nonSkippedColumns) {
|