relq 1.0.0 → 1.0.1
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.
|
@@ -366,12 +366,14 @@ function parseTableBody(body, enums, domains) {
|
|
|
366
366
|
const trimmed = part.trim();
|
|
367
367
|
if (!trimmed)
|
|
368
368
|
continue;
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
369
|
+
const upper = trimmed.toUpperCase();
|
|
370
|
+
const isConstraint = upper.startsWith('CONSTRAINT ') ||
|
|
371
|
+
/^PRIMARY\s+KEY\s*\(/i.test(trimmed) ||
|
|
372
|
+
/^FOREIGN\s+KEY\s*\(/i.test(trimmed) ||
|
|
373
|
+
/^UNIQUE\s*\(/i.test(trimmed) ||
|
|
374
|
+
/^CHECK\s*\(/i.test(trimmed) ||
|
|
375
|
+
/^EXCLUDE\s+(?:USING\s+|ON\s+|\()/i.test(trimmed);
|
|
376
|
+
if (isConstraint) {
|
|
375
377
|
const constraint = parseConstraint(trimmed);
|
|
376
378
|
if (constraint) {
|
|
377
379
|
constraints.push(constraint);
|
|
@@ -359,12 +359,14 @@ function parseTableBody(body, enums, domains) {
|
|
|
359
359
|
const trimmed = part.trim();
|
|
360
360
|
if (!trimmed)
|
|
361
361
|
continue;
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
362
|
+
const upper = trimmed.toUpperCase();
|
|
363
|
+
const isConstraint = upper.startsWith('CONSTRAINT ') ||
|
|
364
|
+
/^PRIMARY\s+KEY\s*\(/i.test(trimmed) ||
|
|
365
|
+
/^FOREIGN\s+KEY\s*\(/i.test(trimmed) ||
|
|
366
|
+
/^UNIQUE\s*\(/i.test(trimmed) ||
|
|
367
|
+
/^CHECK\s*\(/i.test(trimmed) ||
|
|
368
|
+
/^EXCLUDE\s+(?:USING\s+|ON\s+|\()/i.test(trimmed);
|
|
369
|
+
if (isConstraint) {
|
|
368
370
|
const constraint = parseConstraint(trimmed);
|
|
369
371
|
if (constraint) {
|
|
370
372
|
constraints.push(constraint);
|