@mikro-orm/postgresql 6.6.8-dev.4 → 6.6.8-dev.5
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.
|
@@ -180,10 +180,16 @@ class PostgreSqlSchemaHelper extends knex_1.SchemaHelper {
|
|
|
180
180
|
const sql = this.getChecksSQL(tablesBySchemas);
|
|
181
181
|
const allChecks = await connection.execute(sql);
|
|
182
182
|
const ret = {};
|
|
183
|
+
const seen = new Set();
|
|
183
184
|
for (const check of allChecks) {
|
|
184
185
|
const key = this.getTableKey(check);
|
|
186
|
+
const dedupeKey = `${key}:${check.name}`;
|
|
187
|
+
if (seen.has(dedupeKey)) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
seen.add(dedupeKey);
|
|
185
191
|
ret[key] ??= [];
|
|
186
|
-
const m = check.expression.match(/^check \(\((.*)\)\)$/
|
|
192
|
+
const m = check.expression.match(/^check \(\((.*)\)\)$/is);
|
|
187
193
|
const def = m?.[1].replace(/\((.*?)\)::\w+/g, '$1');
|
|
188
194
|
ret[key].push({
|
|
189
195
|
name: check.name,
|
|
@@ -523,7 +529,7 @@ class PostgreSqlSchemaHelper extends knex_1.SchemaHelper {
|
|
|
523
529
|
from pg_constraint pgc
|
|
524
530
|
join pg_namespace nsp on nsp.oid = pgc.connamespace
|
|
525
531
|
join pg_class cls on pgc.conrelid = cls.oid
|
|
526
|
-
join information_schema.constraint_column_usage ccu on pgc.conname = ccu.constraint_name and nsp.nspname = ccu.constraint_schema
|
|
532
|
+
join information_schema.constraint_column_usage ccu on pgc.conname = ccu.constraint_name and nsp.nspname = ccu.constraint_schema and cls.relname = ccu.table_name
|
|
527
533
|
where contype = 'c' and (${[...tablesBySchemas.entries()].map(([schema, tables]) => `ccu.table_name in (${tables.map(t => this.platform.quoteValue(t.table_name)).join(',')}) and ccu.table_schema = ${this.platform.quoteValue(schema ?? this.platform.getDefaultSchemaName() ?? '')}`).join(' or ')})
|
|
528
534
|
order by pgc.conname`;
|
|
529
535
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/postgresql",
|
|
3
|
-
"version": "6.6.8-dev.
|
|
3
|
+
"version": "6.6.8-dev.5",
|
|
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,7 +58,7 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@mikro-orm/knex": "6.6.8-dev.
|
|
61
|
+
"@mikro-orm/knex": "6.6.8-dev.5",
|
|
62
62
|
"pg": "8.19.0",
|
|
63
63
|
"postgres-array": "3.0.4",
|
|
64
64
|
"postgres-date": "2.1.0",
|
|
@@ -68,6 +68,6 @@
|
|
|
68
68
|
"@mikro-orm/core": "^6.6.7"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@mikro-orm/core": "6.6.8-dev.
|
|
71
|
+
"@mikro-orm/core": "6.6.8-dev.5"
|
|
72
72
|
}
|
|
73
73
|
}
|