drizzle-kit 0.25.0-178591 → 0.25.0-680d055
Sign up to get free protection for your applications and to get access to all the features.
- package/api.d.mts +0 -82
- package/api.d.ts +0 -82
- package/api.js +529 -1011
- package/api.mjs +528 -1010
- package/bin.cjs +139 -793
- package/package.json +1 -1
- package/utils.js +6 -24
- package/utils.mjs +6 -24
package/bin.cjs
CHANGED
@@ -1315,11 +1315,6 @@ Is ${source_default.bold.blue(
|
|
1315
1315
|
count: 0,
|
1316
1316
|
name: "foreign keys",
|
1317
1317
|
status: "fetching"
|
1318
|
-
},
|
1319
|
-
checks: {
|
1320
|
-
count: 0,
|
1321
|
-
name: "check constraints",
|
1322
|
-
status: "fetching"
|
1323
1318
|
}
|
1324
1319
|
};
|
1325
1320
|
this.formatCount = (count) => {
|
@@ -1357,7 +1352,6 @@ Is ${source_default.bold.blue(
|
|
1357
1352
|
info2 += this.hasEnums ? this.statusText(spin, this.state.enums) : "";
|
1358
1353
|
info2 += this.statusText(spin, this.state.indexes);
|
1359
1354
|
info2 += this.statusText(spin, this.state.fks);
|
1360
|
-
info2 += this.statusText(spin, this.state.checks);
|
1361
1355
|
return info2;
|
1362
1356
|
}
|
1363
1357
|
};
|
@@ -5427,7 +5421,7 @@ var init_lib = __esm({
|
|
5427
5421
|
});
|
5428
5422
|
|
5429
5423
|
// src/serializer/mysqlSchema.ts
|
5430
|
-
var index, fk, column, tableV3, compositePK, uniqueConstraint,
|
5424
|
+
var index, fk, column, tableV3, compositePK, uniqueConstraint, tableV4, table, kitInternals, dialect, schemaHash, schemaInternalV3, schemaInternalV4, schemaInternalV5, schemaInternal, schemaV3, schemaV4, schemaV5, schema2, tableSquashedV4, tableSquashed, schemaSquashed, schemaSquashedV4, MySqlSquasher, squashMysqlScheme, mysqlSchema, mysqlSchemaV5, mysqlSchemaSquashed, backwardCompatibleMysqlSchema, dryMySql;
|
5431
5425
|
var init_mysqlSchema = __esm({
|
5432
5426
|
"src/serializer/mysqlSchema.ts"() {
|
5433
5427
|
"use strict";
|
@@ -5477,10 +5471,6 @@ var init_mysqlSchema = __esm({
|
|
5477
5471
|
name: stringType(),
|
5478
5472
|
columns: stringType().array()
|
5479
5473
|
}).strict();
|
5480
|
-
checkConstraint = objectType({
|
5481
|
-
name: stringType(),
|
5482
|
-
value: stringType()
|
5483
|
-
}).strict();
|
5484
5474
|
tableV4 = objectType({
|
5485
5475
|
name: stringType(),
|
5486
5476
|
schema: stringType().optional(),
|
@@ -5494,8 +5484,7 @@ var init_mysqlSchema = __esm({
|
|
5494
5484
|
indexes: recordType(stringType(), index),
|
5495
5485
|
foreignKeys: recordType(stringType(), fk),
|
5496
5486
|
compositePrimaryKeys: recordType(stringType(), compositePK),
|
5497
|
-
uniqueConstraints: recordType(stringType(), uniqueConstraint).default({})
|
5498
|
-
checkConstraint: recordType(stringType(), checkConstraint).default({})
|
5487
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint).default({})
|
5499
5488
|
}).strict();
|
5500
5489
|
kitInternals = objectType({
|
5501
5490
|
tables: recordType(
|
@@ -5572,8 +5561,7 @@ var init_mysqlSchema = __esm({
|
|
5572
5561
|
indexes: recordType(stringType(), stringType()),
|
5573
5562
|
foreignKeys: recordType(stringType(), stringType()),
|
5574
5563
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
5575
|
-
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
5576
|
-
checkConstraints: recordType(stringType(), stringType()).default({})
|
5564
|
+
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
5577
5565
|
}).strict();
|
5578
5566
|
schemaSquashed = objectType({
|
5579
5567
|
version: literalType("5"),
|
@@ -5640,13 +5628,6 @@ var init_mysqlSchema = __esm({
|
|
5640
5628
|
onDelete
|
5641
5629
|
});
|
5642
5630
|
return result;
|
5643
|
-
},
|
5644
|
-
squashCheck: (input) => {
|
5645
|
-
return `${input.name};${input.value}`;
|
5646
|
-
},
|
5647
|
-
unsquashCheck: (input) => {
|
5648
|
-
const [name, value] = input.split(";");
|
5649
|
-
return { name, value };
|
5650
5631
|
}
|
5651
5632
|
};
|
5652
5633
|
squashMysqlScheme = (json) => {
|
@@ -5667,9 +5648,6 @@ var init_mysqlSchema = __esm({
|
|
5667
5648
|
return MySqlSquasher.squashUnique(unq);
|
5668
5649
|
}
|
5669
5650
|
);
|
5670
|
-
const squashedCheckConstraints = mapValues(it[1].checkConstraint, (check2) => {
|
5671
|
-
return MySqlSquasher.squashCheck(check2);
|
5672
|
-
});
|
5673
5651
|
return [
|
5674
5652
|
it[0],
|
5675
5653
|
{
|
@@ -5678,8 +5656,7 @@ var init_mysqlSchema = __esm({
|
|
5678
5656
|
indexes: squashedIndexes,
|
5679
5657
|
foreignKeys: squashedFKs,
|
5680
5658
|
compositePrimaryKeys: squashedPKs,
|
5681
|
-
uniqueConstraints: squashedUniqueConstraints
|
5682
|
-
checkConstraints: squashedCheckConstraints
|
5659
|
+
uniqueConstraints: squashedUniqueConstraints
|
5683
5660
|
}
|
5684
5661
|
];
|
5685
5662
|
})
|
@@ -5729,7 +5706,7 @@ var init_vector = __esm({
|
|
5729
5706
|
});
|
5730
5707
|
|
5731
5708
|
// src/serializer/pgSchema.ts
|
5732
|
-
var indexV2, columnV2, tableV2, enumSchemaV1, enumSchema, pgSchemaV2, references, columnV1, tableV1, pgSchemaV1, indexColumn, index2, indexV4, indexV5, indexV6, fk2, sequenceSchema, sequenceSquashed, columnV7, column2,
|
5709
|
+
var indexV2, columnV2, tableV2, enumSchemaV1, enumSchema, pgSchemaV2, references, columnV1, tableV1, pgSchemaV1, indexColumn, index2, indexV4, indexV5, indexV6, fk2, sequenceSchema, sequenceSquashed, columnV7, column2, columnSquashed, tableV32, compositePK2, uniqueConstraint2, tableV42, tableV5, tableV6, tableV7, table2, schemaHash2, kitInternals2, pgSchemaInternalV3, pgSchemaInternalV4, pgSchemaInternalV5, pgSchemaInternalV6, pgSchemaExternal, pgSchemaInternalV7, pgSchemaInternal, tableSquashed2, tableSquashedV42, pgSchemaSquashedV4, pgSchemaSquashedV6, pgSchemaSquashed, pgSchemaV3, pgSchemaV4, pgSchemaV5, pgSchemaV6, pgSchemaV7, pgSchema, backwardCompatiblePgSchema, PgSquasher, squashPgScheme, dryPg;
|
5733
5710
|
var init_pgSchema = __esm({
|
5734
5711
|
"src/serializer/pgSchema.ts"() {
|
5735
5712
|
"use strict";
|
@@ -5893,10 +5870,6 @@ var init_pgSchema = __esm({
|
|
5893
5870
|
}).optional(),
|
5894
5871
|
identity: sequenceSchema.merge(objectType({ type: enumType(["always", "byDefault"]) })).optional()
|
5895
5872
|
}).strict();
|
5896
|
-
checkConstraint2 = objectType({
|
5897
|
-
name: stringType(),
|
5898
|
-
value: stringType()
|
5899
|
-
}).strict();
|
5900
5873
|
columnSquashed = objectType({
|
5901
5874
|
name: stringType(),
|
5902
5875
|
type: stringType(),
|
@@ -5969,8 +5942,7 @@ var init_pgSchema = __esm({
|
|
5969
5942
|
indexes: recordType(stringType(), index2),
|
5970
5943
|
foreignKeys: recordType(stringType(), fk2),
|
5971
5944
|
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
5972
|
-
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
5973
|
-
checkConstraints: recordType(stringType(), checkConstraint2).default({})
|
5945
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
5974
5946
|
}).strict();
|
5975
5947
|
schemaHash2 = objectType({
|
5976
5948
|
id: stringType(),
|
@@ -6078,8 +6050,7 @@ var init_pgSchema = __esm({
|
|
6078
6050
|
indexes: recordType(stringType(), stringType()),
|
6079
6051
|
foreignKeys: recordType(stringType(), stringType()),
|
6080
6052
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
6081
|
-
uniqueConstraints: recordType(stringType(), stringType())
|
6082
|
-
checkConstraints: recordType(stringType(), stringType())
|
6053
|
+
uniqueConstraints: recordType(stringType(), stringType())
|
6083
6054
|
}).strict();
|
6084
6055
|
tableSquashedV42 = objectType({
|
6085
6056
|
name: stringType(),
|
@@ -6261,16 +6232,6 @@ var init_pgSchema = __esm({
|
|
6261
6232
|
cache: splitted[6] !== "undefined" ? splitted[6] : void 0,
|
6262
6233
|
cycle: splitted[7] === "true"
|
6263
6234
|
};
|
6264
|
-
},
|
6265
|
-
squashCheck: (check2) => {
|
6266
|
-
return `${check2.name};${check2.value}`;
|
6267
|
-
},
|
6268
|
-
unsquashCheck: (input) => {
|
6269
|
-
const [
|
6270
|
-
name,
|
6271
|
-
value
|
6272
|
-
] = input.split(";");
|
6273
|
-
return { name, value };
|
6274
6235
|
}
|
6275
6236
|
};
|
6276
6237
|
squashPgScheme = (json, action) => {
|
@@ -6303,12 +6264,6 @@ var init_pgSchema = __esm({
|
|
6303
6264
|
return PgSquasher.squashUnique(unq);
|
6304
6265
|
}
|
6305
6266
|
);
|
6306
|
-
const squashedChecksContraints = mapValues(
|
6307
|
-
it[1].checkConstraints,
|
6308
|
-
(check2) => {
|
6309
|
-
return PgSquasher.squashCheck(check2);
|
6310
|
-
}
|
6311
|
-
);
|
6312
6267
|
return [
|
6313
6268
|
it[0],
|
6314
6269
|
{
|
@@ -6318,8 +6273,7 @@ var init_pgSchema = __esm({
|
|
6318
6273
|
indexes: squashedIndexes,
|
6319
6274
|
foreignKeys: squashedFKs,
|
6320
6275
|
compositePrimaryKeys: squashedPKs,
|
6321
|
-
uniqueConstraints: squashedUniqueConstraints
|
6322
|
-
checkConstraints: squashedChecksContraints
|
6276
|
+
uniqueConstraints: squashedUniqueConstraints
|
6323
6277
|
}
|
6324
6278
|
];
|
6325
6279
|
})
|
@@ -6364,7 +6318,7 @@ var init_pgSchema = __esm({
|
|
6364
6318
|
});
|
6365
6319
|
|
6366
6320
|
// src/serializer/sqliteSchema.ts
|
6367
|
-
var index3, fk3, compositePK3, column3, tableV33, uniqueConstraint3,
|
6321
|
+
var index3, fk3, compositePK3, column3, tableV33, uniqueConstraint3, table3, dialect2, schemaHash3, schemaInternalV32, schemaInternalV42, schemaInternalV52, kitInternals3, latestVersion, schemaInternal2, schemaV32, schemaV42, schemaV52, schema3, tableSquashed3, schemaSquashed2, SQLiteSquasher, squashSqliteScheme, drySQLite, sqliteSchemaV5, sqliteSchema, SQLiteSchemaSquashed, backwardCompatibleSqliteSchema;
|
6368
6322
|
var init_sqliteSchema = __esm({
|
6369
6323
|
"src/serializer/sqliteSchema.ts"() {
|
6370
6324
|
"use strict";
|
@@ -6411,18 +6365,13 @@ var init_sqliteSchema = __esm({
|
|
6411
6365
|
name: stringType(),
|
6412
6366
|
columns: stringType().array()
|
6413
6367
|
}).strict();
|
6414
|
-
checkConstraint3 = objectType({
|
6415
|
-
name: stringType(),
|
6416
|
-
value: stringType()
|
6417
|
-
}).strict();
|
6418
6368
|
table3 = objectType({
|
6419
6369
|
name: stringType(),
|
6420
6370
|
columns: recordType(stringType(), column3),
|
6421
6371
|
indexes: recordType(stringType(), index3),
|
6422
6372
|
foreignKeys: recordType(stringType(), fk3),
|
6423
6373
|
compositePrimaryKeys: recordType(stringType(), compositePK3),
|
6424
|
-
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
|
6425
|
-
checkConstraints: recordType(stringType(), checkConstraint3).default({})
|
6374
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
|
6426
6375
|
}).strict();
|
6427
6376
|
dialect2 = enumType(["sqlite"]);
|
6428
6377
|
schemaHash3 = objectType({
|
@@ -6484,8 +6433,7 @@ var init_sqliteSchema = __esm({
|
|
6484
6433
|
indexes: recordType(stringType(), stringType()),
|
6485
6434
|
foreignKeys: recordType(stringType(), stringType()),
|
6486
6435
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
6487
|
-
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
6488
|
-
checkConstraints: recordType(stringType(), stringType()).default({})
|
6436
|
+
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
6489
6437
|
}).strict();
|
6490
6438
|
schemaSquashed2 = objectType({
|
6491
6439
|
version: latestVersion,
|
@@ -6567,16 +6515,6 @@ var init_sqliteSchema = __esm({
|
|
6567
6515
|
},
|
6568
6516
|
unsquashPK: (pk) => {
|
6569
6517
|
return pk.split(",");
|
6570
|
-
},
|
6571
|
-
squashCheck: (check2) => {
|
6572
|
-
return `${check2.name};${check2.value}`;
|
6573
|
-
},
|
6574
|
-
unsquashCheck: (input) => {
|
6575
|
-
const [
|
6576
|
-
name,
|
6577
|
-
value
|
6578
|
-
] = input.split(";");
|
6579
|
-
return { name, value };
|
6580
6518
|
}
|
6581
6519
|
};
|
6582
6520
|
squashSqliteScheme = (json, action) => {
|
@@ -6603,12 +6541,6 @@ var init_sqliteSchema = __esm({
|
|
6603
6541
|
return SQLiteSquasher.squashUnique(unq);
|
6604
6542
|
}
|
6605
6543
|
);
|
6606
|
-
const squashedCheckConstraints = mapValues(
|
6607
|
-
it[1].checkConstraints,
|
6608
|
-
(check2) => {
|
6609
|
-
return SQLiteSquasher.squashCheck(check2);
|
6610
|
-
}
|
6611
|
-
);
|
6612
6544
|
return [
|
6613
6545
|
it[0],
|
6614
6546
|
{
|
@@ -6617,8 +6549,7 @@ var init_sqliteSchema = __esm({
|
|
6617
6549
|
indexes: squashedIndexes,
|
6618
6550
|
foreignKeys: squashedFKs,
|
6619
6551
|
compositePrimaryKeys: squashedPKs,
|
6620
|
-
uniqueConstraints: squashedUniqueConstraints
|
6621
|
-
checkConstraints: squashedCheckConstraints
|
6552
|
+
uniqueConstraints: squashedUniqueConstraints
|
6622
6553
|
}
|
6623
6554
|
];
|
6624
6555
|
})
|
@@ -18000,7 +17931,6 @@ var init_mysqlSerializer = __esm({
|
|
18000
17931
|
indexes,
|
18001
17932
|
foreignKeys,
|
18002
17933
|
schema: schema5,
|
18003
|
-
checks,
|
18004
17934
|
primaryKeys,
|
18005
17935
|
uniqueConstraints
|
18006
17936
|
} = (0, import_mysql_core3.getTableConfig)(table4);
|
@@ -18009,8 +17939,6 @@ var init_mysqlSerializer = __esm({
|
|
18009
17939
|
const foreignKeysObject = {};
|
18010
17940
|
const primaryKeysObject = {};
|
18011
17941
|
const uniqueConstraintObject = {};
|
18012
|
-
const checkConstraintObject = {};
|
18013
|
-
let checksInTable = {};
|
18014
17942
|
columns.forEach((column7) => {
|
18015
17943
|
const notNull = column7.notNull;
|
18016
17944
|
const sqlTypeLowered = column7.getSQLType().toLowerCase();
|
@@ -18224,32 +18152,6 @@ We have encountered a collision between the index name on columns ${source_defau
|
|
18224
18152
|
lock: value.config.lock
|
18225
18153
|
};
|
18226
18154
|
});
|
18227
|
-
checks.forEach((check2) => {
|
18228
|
-
check2;
|
18229
|
-
const checkName = check2.name;
|
18230
|
-
if (typeof checksInTable[tableName] !== "undefined") {
|
18231
|
-
if (checksInTable[tableName].includes(check2.name)) {
|
18232
|
-
console.log(
|
18233
|
-
`
|
18234
|
-
${withStyle.errorWarning(
|
18235
|
-
`We've found duplicated check constraint name in ${source_default.underline.blue(
|
18236
|
-
tableName
|
18237
|
-
)}. Please rename your check constraint in the ${source_default.underline.blue(
|
18238
|
-
tableName
|
18239
|
-
)} table`
|
18240
|
-
)}`
|
18241
|
-
);
|
18242
|
-
process.exit(1);
|
18243
|
-
}
|
18244
|
-
checksInTable[tableName].push(checkName);
|
18245
|
-
} else {
|
18246
|
-
checksInTable[tableName] = [check2.name];
|
18247
|
-
}
|
18248
|
-
checkConstraintObject[checkName] = {
|
18249
|
-
name: checkName,
|
18250
|
-
value: dialect4.sqlToQuery(check2.value).sql
|
18251
|
-
};
|
18252
|
-
});
|
18253
18155
|
if (!schema5) {
|
18254
18156
|
result[tableName] = {
|
18255
18157
|
name: tableName,
|
@@ -18257,8 +18159,7 @@ ${withStyle.errorWarning(
|
|
18257
18159
|
indexes: indexesObject,
|
18258
18160
|
foreignKeys: foreignKeysObject,
|
18259
18161
|
compositePrimaryKeys: primaryKeysObject,
|
18260
|
-
uniqueConstraints: uniqueConstraintObject
|
18261
|
-
checkConstraint: checkConstraintObject
|
18162
|
+
uniqueConstraints: uniqueConstraintObject
|
18262
18163
|
};
|
18263
18164
|
}
|
18264
18165
|
}
|
@@ -18285,7 +18186,6 @@ ${withStyle.errorWarning(
|
|
18285
18186
|
let tablesCount = /* @__PURE__ */ new Set();
|
18286
18187
|
let indexesCount = 0;
|
18287
18188
|
let foreignKeysCount = 0;
|
18288
|
-
let checksCount = 0;
|
18289
18189
|
const idxs = await db.query(
|
18290
18190
|
`select * from INFORMATION_SCHEMA.STATISTICS
|
18291
18191
|
WHERE INFORMATION_SCHEMA.STATISTICS.TABLE_SCHEMA = '${inputSchema}' and INFORMATION_SCHEMA.STATISTICS.INDEX_NAME != 'PRIMARY';`
|
@@ -18381,8 +18281,7 @@ ${withStyle.errorWarning(
|
|
18381
18281
|
compositePrimaryKeys: {},
|
18382
18282
|
indexes: {},
|
18383
18283
|
foreignKeys: {},
|
18384
|
-
uniqueConstraints: {}
|
18385
|
-
checkConstraint: {}
|
18284
|
+
uniqueConstraints: {}
|
18386
18285
|
};
|
18387
18286
|
} else {
|
18388
18287
|
result[tableName].columns[columnName] = newColumn;
|
@@ -18533,38 +18432,6 @@ ${withStyle.errorWarning(
|
|
18533
18432
|
progressCallback("indexes", indexesCount, "done");
|
18534
18433
|
progressCallback("enums", 0, "done");
|
18535
18434
|
}
|
18536
|
-
const checkConstraints = await db.query(
|
18537
|
-
`SELECT
|
18538
|
-
tc.table_name,
|
18539
|
-
tc.constraint_name,
|
18540
|
-
cc.check_clause
|
18541
|
-
FROM
|
18542
|
-
information_schema.table_constraints tc
|
18543
|
-
JOIN
|
18544
|
-
information_schema.check_constraints cc
|
18545
|
-
ON tc.constraint_name = cc.constraint_name
|
18546
|
-
WHERE
|
18547
|
-
tc.constraint_schema = '${inputSchema}'
|
18548
|
-
AND
|
18549
|
-
tc.constraint_type = 'CHECK';`
|
18550
|
-
);
|
18551
|
-
checksCount += checkConstraints.length;
|
18552
|
-
if (progressCallback) {
|
18553
|
-
progressCallback("checks", checksCount, "fetching");
|
18554
|
-
}
|
18555
|
-
for (const checkConstraintRow of checkConstraints) {
|
18556
|
-
const constraintName = checkConstraintRow["CONSTRAINT_NAME"];
|
18557
|
-
const constraintValue = checkConstraintRow["CHECK_CLAUSE"];
|
18558
|
-
const tableName = checkConstraintRow["TABLE_NAME"];
|
18559
|
-
const tableInResult = result[tableName];
|
18560
|
-
tableInResult.checkConstraint[constraintName] = {
|
18561
|
-
name: constraintName,
|
18562
|
-
value: constraintValue
|
18563
|
-
};
|
18564
|
-
}
|
18565
|
-
if (progressCallback) {
|
18566
|
-
progressCallback("checks", checksCount, "done");
|
18567
|
-
}
|
18568
18435
|
return {
|
18569
18436
|
version: "5",
|
18570
18437
|
dialect: "mysql",
|
@@ -18701,7 +18568,6 @@ var init_pgSerializer = __esm({
|
|
18701
18568
|
const sequencesToReturn = {};
|
18702
18569
|
const indexesInSchema = {};
|
18703
18570
|
for (const table4 of tables) {
|
18704
|
-
const checksInTable = {};
|
18705
18571
|
const {
|
18706
18572
|
name: tableName,
|
18707
18573
|
columns,
|
@@ -18717,7 +18583,6 @@ var init_pgSerializer = __esm({
|
|
18717
18583
|
}
|
18718
18584
|
const columnsObject = {};
|
18719
18585
|
const indexesObject = {};
|
18720
|
-
const checksObject = {};
|
18721
18586
|
const foreignKeysObject = {};
|
18722
18587
|
const primaryKeysObject = {};
|
18723
18588
|
const uniqueConstraintObject = {};
|
@@ -18966,33 +18831,6 @@ ${withStyle.errorWarning(
|
|
18966
18831
|
with: value.config.with ?? {}
|
18967
18832
|
};
|
18968
18833
|
});
|
18969
|
-
checks.forEach((check2) => {
|
18970
|
-
const checkName = check2.name;
|
18971
|
-
if (typeof checksInTable[`"${schema5 ?? "public"}"."${tableName}"`] !== "undefined") {
|
18972
|
-
if (checksInTable[`"${schema5 ?? "public"}"."${tableName}"`].includes(check2.name)) {
|
18973
|
-
console.log(
|
18974
|
-
`
|
18975
|
-
${withStyle.errorWarning(
|
18976
|
-
`We've found duplicated check constraint name across ${source_default.underline.blue(
|
18977
|
-
schema5 ?? "public"
|
18978
|
-
)} schema in ${source_default.underline.blue(
|
18979
|
-
tableName
|
18980
|
-
)}. Please rename your check constraint in either the ${source_default.underline.blue(
|
18981
|
-
tableName
|
18982
|
-
)} table or the table with the duplicated check contraint name`
|
18983
|
-
)}`
|
18984
|
-
);
|
18985
|
-
process.exit(1);
|
18986
|
-
}
|
18987
|
-
checksInTable[`"${schema5 ?? "public"}"."${tableName}"`].push(checkName);
|
18988
|
-
} else {
|
18989
|
-
checksInTable[`"${schema5 ?? "public"}"."${tableName}"`] = [check2.name];
|
18990
|
-
}
|
18991
|
-
checksObject[checkName] = {
|
18992
|
-
name: checkName,
|
18993
|
-
value: dialect5.sqlToQuery(check2.value).sql
|
18994
|
-
};
|
18995
|
-
});
|
18996
18834
|
const tableKey2 = `${schema5 ?? "public"}.${tableName}`;
|
18997
18835
|
result[tableKey2] = {
|
18998
18836
|
name: tableName,
|
@@ -19001,8 +18839,7 @@ ${withStyle.errorWarning(
|
|
19001
18839
|
indexes: indexesObject,
|
19002
18840
|
foreignKeys: foreignKeysObject,
|
19003
18841
|
compositePrimaryKeys: primaryKeysObject,
|
19004
|
-
uniqueConstraints: uniqueConstraintObject
|
19005
|
-
checkConstraints: checksObject
|
18842
|
+
uniqueConstraints: uniqueConstraintObject
|
19006
18843
|
};
|
19007
18844
|
}
|
19008
18845
|
for (const sequence of sequences) {
|
@@ -19093,7 +18930,6 @@ ${withStyle.errorWarning(
|
|
19093
18930
|
let indexesCount = 0;
|
19094
18931
|
let foreignKeysCount = 0;
|
19095
18932
|
let tableCount = 0;
|
19096
|
-
let checksCount = 0;
|
19097
18933
|
const sequencesToReturn = {};
|
19098
18934
|
const seqWhere = schemaFilters.map((t2) => `schemaname = '${t2}'`).join(" or ");
|
19099
18935
|
const allSequences = await db.query(
|
@@ -19165,8 +19001,7 @@ ${withStyle.errorWarning(
|
|
19165
19001
|
const indexToReturn = {};
|
19166
19002
|
const foreignKeysToReturn = {};
|
19167
19003
|
const primaryKeys = {};
|
19168
|
-
const
|
19169
|
-
const checkConstraints = {};
|
19004
|
+
const uniqueConstrains = {};
|
19170
19005
|
const tableResponse = await db.query(
|
19171
19006
|
`SELECT a.attrelid::regclass::text, a.attname, is_nullable, a.attndims as array_dimensions
|
19172
19007
|
, CASE WHEN a.atttypid = ANY ('{int,int8,int2}'::regtype[])
|
@@ -19204,97 +19039,55 @@ ${withStyle.errorWarning(
|
|
19204
19039
|
ORDER BY a.attnum;`
|
19205
19040
|
);
|
19206
19041
|
const tableConstraints = await db.query(
|
19207
|
-
`SELECT c.column_name,
|
19208
|
-
|
19209
|
-
|
19210
|
-
|
19211
|
-
|
19212
|
-
|
19213
|
-
FROM information_schema.table_constraints tc
|
19214
|
-
JOIN information_schema.constraint_column_usage AS ccu
|
19215
|
-
USING (constraint_schema, constraint_name)
|
19216
|
-
JOIN information_schema.columns AS c
|
19217
|
-
ON c.table_schema = tc.constraint_schema
|
19218
|
-
AND tc.table_name = c.table_name
|
19219
|
-
AND ccu.column_name = c.column_name
|
19220
|
-
JOIN pg_constraint con
|
19221
|
-
ON con.conname = tc.constraint_name
|
19222
|
-
AND con.conrelid = (
|
19223
|
-
SELECT oid
|
19224
|
-
FROM pg_class
|
19225
|
-
WHERE relname = tc.table_name
|
19226
|
-
AND relnamespace = (
|
19227
|
-
SELECT oid
|
19228
|
-
FROM pg_namespace
|
19229
|
-
WHERE nspname = tc.constraint_schema
|
19230
|
-
)
|
19231
|
-
)
|
19232
|
-
WHERE tc.table_name = '${tableName}' AND tc.constraint_schema = '${tableSchema}';`
|
19042
|
+
`SELECT c.column_name, c.data_type, constraint_type, constraint_name, constraint_schema
|
19043
|
+
FROM information_schema.table_constraints tc
|
19044
|
+
JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name)
|
19045
|
+
JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema
|
19046
|
+
AND tc.table_name = c.table_name AND ccu.column_name = c.column_name
|
19047
|
+
WHERE tc.table_name = '${tableName}' and constraint_schema = '${tableSchema}';`
|
19233
19048
|
);
|
19234
|
-
const tableChecks = await db.query(`SELECT
|
19235
|
-
tc.constraint_name,
|
19236
|
-
tc.constraint_type,
|
19237
|
-
pg_get_constraintdef(con.oid) AS constraint_definition
|
19238
|
-
FROM
|
19239
|
-
information_schema.table_constraints AS tc
|
19240
|
-
JOIN pg_constraint AS con
|
19241
|
-
ON tc.constraint_name = con.conname
|
19242
|
-
AND con.conrelid = (
|
19243
|
-
SELECT oid
|
19244
|
-
FROM pg_class
|
19245
|
-
WHERE relname = tc.table_name
|
19246
|
-
AND relnamespace = (
|
19247
|
-
SELECT oid
|
19248
|
-
FROM pg_namespace
|
19249
|
-
WHERE nspname = tc.constraint_schema
|
19250
|
-
)
|
19251
|
-
)
|
19252
|
-
WHERE
|
19253
|
-
tc.table_name = '${tableName}'
|
19254
|
-
AND tc.constraint_schema = '${tableSchema}'
|
19255
|
-
AND tc.constraint_type = 'CHECK';`);
|
19256
19049
|
columnsCount += tableResponse.length;
|
19257
19050
|
if (progressCallback) {
|
19258
19051
|
progressCallback("columns", columnsCount, "fetching");
|
19259
19052
|
}
|
19260
19053
|
const tableForeignKeys = await db.query(
|
19261
19054
|
`SELECT
|
19262
|
-
|
19263
|
-
|
19264
|
-
|
19265
|
-
|
19266
|
-
|
19267
|
-
|
19268
|
-
|
19269
|
-
|
19270
|
-
|
19271
|
-
|
19272
|
-
|
19273
|
-
|
19274
|
-
|
19275
|
-
|
19276
|
-
|
19277
|
-
|
19278
|
-
|
19279
|
-
|
19280
|
-
|
19281
|
-
|
19282
|
-
|
19283
|
-
|
19284
|
-
|
19285
|
-
|
19286
|
-
|
19287
|
-
|
19288
|
-
|
19289
|
-
|
19290
|
-
|
19291
|
-
|
19292
|
-
|
19293
|
-
|
19294
|
-
|
19295
|
-
|
19296
|
-
|
19297
|
-
|
19055
|
+
con.contype AS constraint_type,
|
19056
|
+
nsp.nspname AS constraint_schema,
|
19057
|
+
con.conname AS constraint_name,
|
19058
|
+
rel.relname AS table_name,
|
19059
|
+
att.attname AS column_name,
|
19060
|
+
fnsp.nspname AS foreign_table_schema,
|
19061
|
+
frel.relname AS foreign_table_name,
|
19062
|
+
fatt.attname AS foreign_column_name,
|
19063
|
+
CASE con.confupdtype
|
19064
|
+
WHEN 'a' THEN 'NO ACTION'
|
19065
|
+
WHEN 'r' THEN 'RESTRICT'
|
19066
|
+
WHEN 'n' THEN 'SET NULL'
|
19067
|
+
WHEN 'c' THEN 'CASCADE'
|
19068
|
+
WHEN 'd' THEN 'SET DEFAULT'
|
19069
|
+
END AS update_rule,
|
19070
|
+
CASE con.confdeltype
|
19071
|
+
WHEN 'a' THEN 'NO ACTION'
|
19072
|
+
WHEN 'r' THEN 'RESTRICT'
|
19073
|
+
WHEN 'n' THEN 'SET NULL'
|
19074
|
+
WHEN 'c' THEN 'CASCADE'
|
19075
|
+
WHEN 'd' THEN 'SET DEFAULT'
|
19076
|
+
END AS delete_rule
|
19077
|
+
FROM
|
19078
|
+
pg_catalog.pg_constraint con
|
19079
|
+
JOIN pg_catalog.pg_class rel ON rel.oid = con.conrelid
|
19080
|
+
JOIN pg_catalog.pg_namespace nsp ON nsp.oid = con.connamespace
|
19081
|
+
LEFT JOIN pg_catalog.pg_attribute att ON att.attnum = ANY (con.conkey)
|
19082
|
+
AND att.attrelid = con.conrelid
|
19083
|
+
LEFT JOIN pg_catalog.pg_class frel ON frel.oid = con.confrelid
|
19084
|
+
LEFT JOIN pg_catalog.pg_namespace fnsp ON fnsp.oid = frel.relnamespace
|
19085
|
+
LEFT JOIN pg_catalog.pg_attribute fatt ON fatt.attnum = ANY (con.confkey)
|
19086
|
+
AND fatt.attrelid = con.confrelid
|
19087
|
+
WHERE
|
19088
|
+
nsp.nspname = '${tableSchema}'
|
19089
|
+
AND rel.relname = '${tableName}'
|
19090
|
+
AND con.contype IN ('f');`
|
19298
19091
|
);
|
19299
19092
|
foreignKeysCount += tableForeignKeys.length;
|
19300
19093
|
if (progressCallback) {
|
@@ -19336,29 +19129,16 @@ ${withStyle.errorWarning(
|
|
19336
19129
|
for (const unqs of uniqueConstrainsRows) {
|
19337
19130
|
const columnName = unqs.column_name;
|
19338
19131
|
const constraintName = unqs.constraint_name;
|
19339
|
-
if (typeof
|
19340
|
-
|
19132
|
+
if (typeof uniqueConstrains[constraintName] !== "undefined") {
|
19133
|
+
uniqueConstrains[constraintName].columns.push(columnName);
|
19341
19134
|
} else {
|
19342
|
-
|
19135
|
+
uniqueConstrains[constraintName] = {
|
19343
19136
|
columns: [columnName],
|
19344
19137
|
nullsNotDistinct: false,
|
19345
19138
|
name: constraintName
|
19346
19139
|
};
|
19347
19140
|
}
|
19348
19141
|
}
|
19349
|
-
checksCount += tableChecks.length;
|
19350
|
-
if (progressCallback) {
|
19351
|
-
progressCallback("checks", checksCount, "fetching");
|
19352
|
-
}
|
19353
|
-
for (const checks of tableChecks) {
|
19354
|
-
let checkValue = checks.constraint_definition;
|
19355
|
-
const constraintName = checks.constraint_name;
|
19356
|
-
checkValue = checkValue.replace(/^CHECK\s*\(\(/, "").replace(/\)\)\s*$/, "");
|
19357
|
-
checkConstraints[constraintName] = {
|
19358
|
-
name: constraintName,
|
19359
|
-
value: checkValue
|
19360
|
-
};
|
19361
|
-
}
|
19362
19142
|
for (const columnResponse of tableResponse) {
|
19363
19143
|
const columnName = columnResponse.attname;
|
19364
19144
|
const columnAdditionalDT = columnResponse.additional_dt;
|
@@ -19603,8 +19383,7 @@ ${withStyle.errorWarning(
|
|
19603
19383
|
indexes: indexToReturn,
|
19604
19384
|
foreignKeys: foreignKeysToReturn,
|
19605
19385
|
compositePrimaryKeys: primaryKeys,
|
19606
|
-
uniqueConstraints
|
19607
|
-
checkConstraints
|
19386
|
+
uniqueConstraints: uniqueConstrains
|
19608
19387
|
};
|
19609
19388
|
} catch (e2) {
|
19610
19389
|
rej(e2);
|
@@ -19622,7 +19401,6 @@ ${withStyle.errorWarning(
|
|
19622
19401
|
progressCallback("columns", columnsCount, "done");
|
19623
19402
|
progressCallback("indexes", indexesCount, "done");
|
19624
19403
|
progressCallback("fks", foreignKeysCount, "done");
|
19625
|
-
progressCallback("checks", checksCount, "done");
|
19626
19404
|
}
|
19627
19405
|
const schemasObject = Object.fromEntries([...schemas].map((it) => [it, it]));
|
19628
19406
|
return {
|
@@ -19835,13 +19613,10 @@ var init_sqliteSerializer = __esm({
|
|
19835
19613
|
const foreignKeysObject = {};
|
19836
19614
|
const primaryKeysObject = {};
|
19837
19615
|
const uniqueConstraintObject = {};
|
19838
|
-
const checkConstraintObject = {};
|
19839
|
-
const checksInTable = {};
|
19840
19616
|
const {
|
19841
19617
|
name: tableName,
|
19842
19618
|
columns,
|
19843
19619
|
indexes,
|
19844
|
-
checks,
|
19845
19620
|
foreignKeys: tableForeignKeys,
|
19846
19621
|
primaryKeys,
|
19847
19622
|
uniqueConstraints
|
@@ -19999,39 +19774,13 @@ The unique constraint ${source_default.underline.blue(
|
|
19999
19774
|
columnsObject[it.columns[0].name].primaryKey = true;
|
20000
19775
|
}
|
20001
19776
|
});
|
20002
|
-
checks.forEach((check2) => {
|
20003
|
-
const checkName = check2.name;
|
20004
|
-
if (typeof checksInTable[tableName] !== "undefined") {
|
20005
|
-
if (checksInTable[tableName].includes(check2.name)) {
|
20006
|
-
console.log(
|
20007
|
-
`
|
20008
|
-
${withStyle.errorWarning(
|
20009
|
-
`We've found duplicated check constraint name in ${source_default.underline.blue(
|
20010
|
-
tableName
|
20011
|
-
)}. Please rename your check constraint in the ${source_default.underline.blue(
|
20012
|
-
tableName
|
20013
|
-
)} table`
|
20014
|
-
)}`
|
20015
|
-
);
|
20016
|
-
process.exit(1);
|
20017
|
-
}
|
20018
|
-
checksInTable[tableName].push(checkName);
|
20019
|
-
} else {
|
20020
|
-
checksInTable[tableName] = [check2.name];
|
20021
|
-
}
|
20022
|
-
checkConstraintObject[checkName] = {
|
20023
|
-
name: checkName,
|
20024
|
-
value: dialect6.sqlToQuery(check2.value).sql
|
20025
|
-
};
|
20026
|
-
});
|
20027
19777
|
result[tableName] = {
|
20028
19778
|
name: tableName,
|
20029
19779
|
columns: columnsObject,
|
20030
19780
|
indexes: indexesObject,
|
20031
19781
|
foreignKeys: foreignKeysObject,
|
20032
19782
|
compositePrimaryKeys: primaryKeysObject,
|
20033
|
-
uniqueConstraints: uniqueConstraintObject
|
20034
|
-
checkConstraints: checkConstraintObject
|
19783
|
+
uniqueConstraints: uniqueConstraintObject
|
20035
19784
|
};
|
20036
19785
|
}
|
20037
19786
|
return {
|
@@ -20078,7 +19827,6 @@ ${withStyle.errorWarning(
|
|
20078
19827
|
let tablesCount = /* @__PURE__ */ new Set();
|
20079
19828
|
let indexesCount = 0;
|
20080
19829
|
let foreignKeysCount = 0;
|
20081
|
-
let checksCount = 0;
|
20082
19830
|
const tableToPk = {};
|
20083
19831
|
let tableToGeneratedColumnsInfo = {};
|
20084
19832
|
for (const column7 of columns) {
|
@@ -20137,8 +19885,7 @@ ${withStyle.errorWarning(
|
|
20137
19885
|
compositePrimaryKeys: {},
|
20138
19886
|
indexes: {},
|
20139
19887
|
foreignKeys: {},
|
20140
|
-
uniqueConstraints: {}
|
20141
|
-
checkConstraints: {}
|
19888
|
+
uniqueConstraints: {}
|
20142
19889
|
};
|
20143
19890
|
} else {
|
20144
19891
|
result[tableName].columns[columnName] = newColumn;
|
@@ -20254,57 +20001,6 @@ WHERE
|
|
20254
20001
|
progressCallback("indexes", indexesCount, "done");
|
20255
20002
|
progressCallback("enums", 0, "done");
|
20256
20003
|
}
|
20257
|
-
const namedCheckPattern = /CONSTRAINT\s*["']?(\w+)["']?\s*CHECK\s*\((.*?)\)/gi;
|
20258
|
-
const unnamedCheckPattern = /CHECK\s*\((.*?)\)/gi;
|
20259
|
-
let checkCounter = 0;
|
20260
|
-
const checkConstraints = {};
|
20261
|
-
const checks = await db.query(`SELECT name as "tableName", sql as "sql"
|
20262
|
-
FROM sqlite_master
|
20263
|
-
WHERE type = 'table' AND name != 'sqlite_sequence';`);
|
20264
|
-
for (const check2 of checks) {
|
20265
|
-
if (!tablesFilter(check2.tableName))
|
20266
|
-
continue;
|
20267
|
-
const { tableName, sql } = check2;
|
20268
|
-
let namedChecks = [...sql.matchAll(namedCheckPattern)];
|
20269
|
-
if (namedChecks.length > 0) {
|
20270
|
-
namedChecks.forEach(([_2, checkName, checkValue]) => {
|
20271
|
-
checkConstraints[checkName] = {
|
20272
|
-
name: checkName,
|
20273
|
-
value: checkValue.trim()
|
20274
|
-
};
|
20275
|
-
});
|
20276
|
-
} else {
|
20277
|
-
let unnamedChecks = [...sql.matchAll(unnamedCheckPattern)];
|
20278
|
-
unnamedChecks.forEach(([_2, checkValue]) => {
|
20279
|
-
let checkName = `${tableName}_check_${++checkCounter}`;
|
20280
|
-
checkConstraints[checkName] = {
|
20281
|
-
name: checkName,
|
20282
|
-
value: checkValue.trim()
|
20283
|
-
};
|
20284
|
-
});
|
20285
|
-
}
|
20286
|
-
checksCount += Object.values(checkConstraints).length;
|
20287
|
-
if (progressCallback) {
|
20288
|
-
progressCallback("checks", checksCount, "fetching");
|
20289
|
-
}
|
20290
|
-
const table4 = result[tableName];
|
20291
|
-
if (!table4) {
|
20292
|
-
result[tableName] = {
|
20293
|
-
name: tableName,
|
20294
|
-
columns: {},
|
20295
|
-
compositePrimaryKeys: {},
|
20296
|
-
indexes: {},
|
20297
|
-
foreignKeys: {},
|
20298
|
-
uniqueConstraints: {},
|
20299
|
-
checkConstraints
|
20300
|
-
};
|
20301
|
-
} else {
|
20302
|
-
result[tableName].checkConstraints = checkConstraints;
|
20303
|
-
}
|
20304
|
-
}
|
20305
|
-
if (progressCallback) {
|
20306
|
-
progressCallback("checks", checksCount, "done");
|
20307
|
-
}
|
20308
20004
|
return {
|
20309
20005
|
version: "6",
|
20310
20006
|
dialect: "sqlite",
|
@@ -23043,21 +22739,6 @@ var init_jsonDiffer = __esm({
|
|
23043
22739
|
return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
|
23044
22740
|
})
|
23045
22741
|
);
|
23046
|
-
const addedCheckConstraints = Object.fromEntries(
|
23047
|
-
Object.entries(table4.checkConstraints || {}).filter((it) => {
|
23048
|
-
return it[0].endsWith("__added");
|
23049
|
-
})
|
23050
|
-
);
|
23051
|
-
const deletedCheckConstraints = Object.fromEntries(
|
23052
|
-
Object.entries(table4.checkConstraints || {}).filter((it) => {
|
23053
|
-
return it[0].endsWith("__deleted");
|
23054
|
-
})
|
23055
|
-
);
|
23056
|
-
const alteredCheckConstraints = Object.fromEntries(
|
23057
|
-
Object.entries(table4.checkConstraints || {}).filter((it) => {
|
23058
|
-
return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
|
23059
|
-
})
|
23060
|
-
);
|
23061
22742
|
const mappedAltered = altered.map((it) => alternationsInColumn(it)).filter(Boolean);
|
23062
22743
|
return {
|
23063
22744
|
name: table4.name,
|
@@ -23074,10 +22755,7 @@ var init_jsonDiffer = __esm({
|
|
23074
22755
|
alteredCompositePKs,
|
23075
22756
|
addedUniqueConstraints,
|
23076
22757
|
deletedUniqueConstraints,
|
23077
|
-
alteredUniqueConstraints
|
23078
|
-
addedCheckConstraints,
|
23079
|
-
deletedCheckConstraints,
|
23080
|
-
alteredCheckConstraints
|
22758
|
+
alteredUniqueConstraints
|
23081
22759
|
};
|
23082
22760
|
};
|
23083
22761
|
alternationsInColumn = (column7) => {
|
@@ -23331,32 +23009,6 @@ var init_jsonDiffer = __esm({
|
|
23331
23009
|
};
|
23332
23010
|
}
|
23333
23011
|
return it;
|
23334
|
-
}).map((it) => {
|
23335
|
-
if ("" in it) {
|
23336
|
-
return {
|
23337
|
-
...it,
|
23338
|
-
autoincrement: {
|
23339
|
-
type: "changed",
|
23340
|
-
old: it.autoincrement.__old,
|
23341
|
-
new: it.autoincrement.__new
|
23342
|
-
}
|
23343
|
-
};
|
23344
|
-
}
|
23345
|
-
if ("autoincrement__added" in it) {
|
23346
|
-
const { autoincrement__added, ...others } = it;
|
23347
|
-
return {
|
23348
|
-
...others,
|
23349
|
-
autoincrement: { type: "added", value: it.autoincrement__added }
|
23350
|
-
};
|
23351
|
-
}
|
23352
|
-
if ("autoincrement__deleted" in it) {
|
23353
|
-
const { autoincrement__deleted, ...others } = it;
|
23354
|
-
return {
|
23355
|
-
...others,
|
23356
|
-
autoincrement: { type: "deleted", value: it.autoincrement__deleted }
|
23357
|
-
};
|
23358
|
-
}
|
23359
|
-
return it;
|
23360
23012
|
}).filter(Boolean);
|
23361
23013
|
return result[0];
|
23362
23014
|
};
|
@@ -23377,7 +23029,7 @@ function fromJson(statements, dialect7, action, json2) {
|
|
23377
23029
|
}).filter((it) => it !== "");
|
23378
23030
|
return result;
|
23379
23031
|
}
|
23380
|
-
var pgNativeTypes, isPgNativeType, Convertor, PgCreateTableConvertor, MySqlCreateTableConvertor, SQLiteCreateTableConvertor, PgAlterTableAlterColumnSetGenerated, PgAlterTableAlterColumnDropGenerated, PgAlterTableAlterColumnAlterGenerated, PgAlterTableAddUniqueConstraintConvertor, PgAlterTableDropUniqueConstraintConvertor,
|
23032
|
+
var pgNativeTypes, isPgNativeType, Convertor, PgCreateTableConvertor, MySqlCreateTableConvertor, SQLiteCreateTableConvertor, PgAlterTableAlterColumnSetGenerated, PgAlterTableAlterColumnDropGenerated, PgAlterTableAlterColumnAlterGenerated, PgAlterTableAddUniqueConstraintConvertor, PgAlterTableDropUniqueConstraintConvertor, MySQLAlterTableAddUniqueConstraintConvertor, MySQLAlterTableDropUniqueConstraintConvertor, CreatePgSequenceConvertor, DropPgSequenceConvertor, RenamePgSequenceConvertor, MovePgSequenceConvertor, AlterPgSequenceConvertor, CreateTypeEnumConvertor, AlterTypeAddValueConvertor, PgDropTableConvertor, MySQLDropTableConvertor, SQLiteDropTableConvertor, PgRenameTableConvertor, SqliteRenameTableConvertor, MySqlRenameTableConvertor, PgAlterTableRenameColumnConvertor, MySqlAlterTableRenameColumnConvertor, SQLiteAlterTableRenameColumnConvertor, PgAlterTableDropColumnConvertor, MySqlAlterTableDropColumnConvertor, SQLiteAlterTableDropColumnConvertor, PgAlterTableAddColumnConvertor, MySqlAlterTableAddColumnConvertor, SQLiteAlterTableAddColumnConvertor, PgAlterTableAlterColumnSetTypeConvertor, PgAlterTableAlterColumnSetDefaultConvertor, PgAlterTableAlterColumnDropDefaultConvertor, PgAlterTableAlterColumnDropGeneratedConvertor, PgAlterTableAlterColumnSetExpressionConvertor, PgAlterTableAlterColumnAlterrGeneratedConvertor, SqliteAlterTableAlterColumnDropGeneratedConvertor, SqliteAlterTableAlterColumnSetExpressionConvertor, SqliteAlterTableAlterColumnAlterGeneratedConvertor, MySqlAlterTableAlterColumnAlterrGeneratedConvertor, MySqlAlterTableAddPk, MySqlAlterTableDropPk, LibSQLModifyColumn, MySqlModifyColumn, PgAlterTableCreateCompositePrimaryKeyConvertor, PgAlterTableDeleteCompositePrimaryKeyConvertor, PgAlterTableAlterCompositePrimaryKeyConvertor, MySqlAlterTableCreateCompositePrimaryKeyConvertor, MySqlAlterTableDeleteCompositePrimaryKeyConvertor, MySqlAlterTableAlterCompositePrimaryKeyConvertor, PgAlterTableAlterColumnSetPrimaryKeyConvertor, PgAlterTableAlterColumnDropPrimaryKeyConvertor, PgAlterTableAlterColumnSetNotNullConvertor, PgAlterTableAlterColumnDropNotNullConvertor, PgCreateForeignKeyConvertor, LibSQLCreateForeignKeyConvertor, MySqlCreateForeignKeyConvertor, PgAlterForeignKeyConvertor, PgDeleteForeignKeyConvertor, MySqlDeleteForeignKeyConvertor, CreatePgIndexConvertor, CreateMySqlIndexConvertor, CreateSqliteIndexConvertor, PgDropIndexConvertor, PgCreateSchemaConvertor, PgRenameSchemaConvertor, PgDropSchemaConvertor, PgAlterTableSetSchemaConvertor, PgAlterTableSetNewSchemaConvertor, PgAlterTableRemoveFromSchemaConvertor, SqliteDropIndexConvertor, MySqlDropIndexConvertor, SQLiteRecreateTableConvertor, LibSQLRecreateTableConvertor, convertors;
|
23381
23033
|
var init_sqlgenerator = __esm({
|
23382
23034
|
"src/sqlgenerator.ts"() {
|
23383
23035
|
"use strict";
|
@@ -23439,7 +23091,7 @@ var init_sqlgenerator = __esm({
|
|
23439
23091
|
return statement.type === "create_table" && dialect7 === "postgresql";
|
23440
23092
|
}
|
23441
23093
|
convert(st) {
|
23442
|
-
const { tableName, schema: schema5, columns, compositePKs, uniqueConstraints
|
23094
|
+
const { tableName, schema: schema5, columns, compositePKs, uniqueConstraints } = st;
|
23443
23095
|
let statement = "";
|
23444
23096
|
const name = schema5 ? `"${schema5}"."${tableName}"` : `"${tableName}"`;
|
23445
23097
|
statement += `CREATE TABLE IF NOT EXISTS ${name} (
|
@@ -23472,13 +23124,6 @@ var init_sqlgenerator = __esm({
|
|
23472
23124
|
statement += ` CONSTRAINT "${unsquashedUnique.name}" UNIQUE${unsquashedUnique.nullsNotDistinct ? " NULLS NOT DISTINCT" : ""}("${unsquashedUnique.columns.join(`","`)}")`;
|
23473
23125
|
}
|
23474
23126
|
}
|
23475
|
-
if (typeof checkConstraints !== "undefined" && checkConstraints.length > 0) {
|
23476
|
-
for (const checkConstraint4 of checkConstraints) {
|
23477
|
-
statement += ",\n";
|
23478
|
-
const unsquashedCheck = PgSquasher.unsquashCheck(checkConstraint4);
|
23479
|
-
statement += ` CONSTRAINT "${unsquashedCheck.name}" CHECK (${unsquashedCheck.value})`;
|
23480
|
-
}
|
23481
|
-
}
|
23482
23127
|
statement += `
|
23483
23128
|
);`;
|
23484
23129
|
statement += `
|
@@ -23496,7 +23141,6 @@ var init_sqlgenerator = __esm({
|
|
23496
23141
|
tableName,
|
23497
23142
|
columns,
|
23498
23143
|
schema: schema5,
|
23499
|
-
checkConstraints,
|
23500
23144
|
compositePKs,
|
23501
23145
|
uniqueConstraints,
|
23502
23146
|
internals
|
@@ -23531,13 +23175,6 @@ var init_sqlgenerator = __esm({
|
|
23531
23175
|
statement += ` CONSTRAINT \`${unsquashedUnique.name}\` UNIQUE(${uniqueString})`;
|
23532
23176
|
}
|
23533
23177
|
}
|
23534
|
-
if (typeof checkConstraints !== "undefined" && checkConstraints.length > 0) {
|
23535
|
-
for (const checkConstraint4 of checkConstraints) {
|
23536
|
-
statement += ",\n";
|
23537
|
-
const unsquashedCheck = MySqlSquasher.unsquashCheck(checkConstraint4);
|
23538
|
-
statement += ` CONSTRAINT \`${unsquashedCheck.name}\` CHECK(${unsquashedCheck.value})`;
|
23539
|
-
}
|
23540
|
-
}
|
23541
23178
|
statement += `
|
23542
23179
|
);`;
|
23543
23180
|
statement += `
|
@@ -23555,8 +23192,7 @@ var init_sqlgenerator = __esm({
|
|
23555
23192
|
columns,
|
23556
23193
|
referenceData,
|
23557
23194
|
compositePKs,
|
23558
|
-
uniqueConstraints
|
23559
|
-
checkConstraints
|
23195
|
+
uniqueConstraints
|
23560
23196
|
} = st;
|
23561
23197
|
let statement = "";
|
23562
23198
|
statement += `CREATE TABLE \`${tableName}\` (
|
@@ -23597,17 +23233,10 @@ var init_sqlgenerator = __esm({
|
|
23597
23233
|
if (typeof uniqueConstraints !== "undefined" && uniqueConstraints.length > 0) {
|
23598
23234
|
for (const uniqueConstraint4 of uniqueConstraints) {
|
23599
23235
|
statement += ",\n";
|
23600
|
-
const unsquashedUnique =
|
23236
|
+
const unsquashedUnique = MySqlSquasher.unsquashUnique(uniqueConstraint4);
|
23601
23237
|
statement += ` CONSTRAINT ${unsquashedUnique.name} UNIQUE(\`${unsquashedUnique.columns.join(`\`,\``)}\`)`;
|
23602
23238
|
}
|
23603
23239
|
}
|
23604
|
-
if (typeof checkConstraints !== "undefined" && checkConstraints.length > 0) {
|
23605
|
-
for (const check2 of checkConstraints) {
|
23606
|
-
statement += ",\n";
|
23607
|
-
const { value, name } = SQLiteSquasher.unsquashCheck(check2);
|
23608
|
-
statement += ` CONSTRAINT "${name}" CHECK(${value})`;
|
23609
|
-
}
|
23610
|
-
}
|
23611
23240
|
statement += `
|
23612
23241
|
`;
|
23613
23242
|
statement += `);`;
|
@@ -23707,25 +23336,6 @@ var init_sqlgenerator = __esm({
|
|
23707
23336
|
return `ALTER TABLE ${tableNameWithSchema} DROP CONSTRAINT "${unsquashed.name}";`;
|
23708
23337
|
}
|
23709
23338
|
};
|
23710
|
-
PgAlterTableAddCheckConstraintConvertor = class extends Convertor {
|
23711
|
-
can(statement, dialect7) {
|
23712
|
-
return statement.type === "create_check_constraint" && dialect7 === "postgresql";
|
23713
|
-
}
|
23714
|
-
convert(statement) {
|
23715
|
-
const unsquashed = PgSquasher.unsquashCheck(statement.data);
|
23716
|
-
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
|
23717
|
-
return `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${unsquashed.name}" CHECK (${unsquashed.value});`;
|
23718
|
-
}
|
23719
|
-
};
|
23720
|
-
PgAlterTableDeleteCheckConstraintConvertor = class extends Convertor {
|
23721
|
-
can(statement, dialect7) {
|
23722
|
-
return statement.type === "delete_check_constraint" && dialect7 === "postgresql";
|
23723
|
-
}
|
23724
|
-
convert(statement) {
|
23725
|
-
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
|
23726
|
-
return `ALTER TABLE ${tableNameWithSchema} DROP CONSTRAINT "${statement.constraintName}";`;
|
23727
|
-
}
|
23728
|
-
};
|
23729
23339
|
MySQLAlterTableAddUniqueConstraintConvertor = class extends Convertor {
|
23730
23340
|
can(statement, dialect7) {
|
23731
23341
|
return statement.type === "create_unique_constraint" && dialect7 === "mysql";
|
@@ -23744,25 +23354,6 @@ var init_sqlgenerator = __esm({
|
|
23744
23354
|
return `ALTER TABLE \`${statement.tableName}\` DROP INDEX \`${unsquashed.name}\`;`;
|
23745
23355
|
}
|
23746
23356
|
};
|
23747
|
-
MySqlAlterTableAddCheckConstraintConvertor = class extends Convertor {
|
23748
|
-
can(statement, dialect7) {
|
23749
|
-
return statement.type === "create_check_constraint" && dialect7 === "mysql";
|
23750
|
-
}
|
23751
|
-
convert(statement) {
|
23752
|
-
const unsquashed = MySqlSquasher.unsquashCheck(statement.data);
|
23753
|
-
const { tableName } = statement;
|
23754
|
-
return `ALTER TABLE \`${tableName}\` ADD CONSTRAINT \`${unsquashed.name}\` CHECK (${unsquashed.value});`;
|
23755
|
-
}
|
23756
|
-
};
|
23757
|
-
MySqlAlterTableDeleteCheckConstraintConvertor = class extends Convertor {
|
23758
|
-
can(statement, dialect7) {
|
23759
|
-
return statement.type === "delete_check_constraint" && dialect7 === "mysql";
|
23760
|
-
}
|
23761
|
-
convert(statement) {
|
23762
|
-
const { tableName } = statement;
|
23763
|
-
return `ALTER TABLE \`${tableName}\` DROP CONSTRAINT \`${statement.constraintName}\`;`;
|
23764
|
-
}
|
23765
|
-
};
|
23766
23357
|
CreatePgSequenceConvertor = class extends Convertor {
|
23767
23358
|
can(statement, dialect7) {
|
23768
23359
|
return statement.type === "create_sequence" && dialect7 === "postgresql";
|
@@ -24317,7 +23908,7 @@ var init_sqlgenerator = __esm({
|
|
24317
23908
|
};
|
24318
23909
|
LibSQLModifyColumn = class extends Convertor {
|
24319
23910
|
can(statement, dialect7) {
|
24320
|
-
return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default"
|
23911
|
+
return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default") && dialect7 === "turso";
|
24321
23912
|
}
|
24322
23913
|
convert(statement, json2) {
|
24323
23914
|
const { tableName, columnName } = statement;
|
@@ -24907,22 +24498,18 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24907
24498
|
return statement.type === "recreate_table" && dialect7 === "sqlite";
|
24908
24499
|
}
|
24909
24500
|
convert(statement) {
|
24910
|
-
const { tableName, columns, compositePKs, referenceData
|
24501
|
+
const { tableName, columns, compositePKs, referenceData } = statement;
|
24911
24502
|
const columnNames = columns.map((it) => `"${it.name}"`).join(", ");
|
24912
24503
|
const newTableName = `__new_${tableName}`;
|
24913
24504
|
const sqlStatements = [];
|
24914
24505
|
sqlStatements.push(`PRAGMA foreign_keys=OFF;`);
|
24915
|
-
const mappedCheckConstraints = checkConstraints.map(
|
24916
|
-
(it) => it.replaceAll(`"${tableName}".`, `"${newTableName}".`).replaceAll(`\`${tableName}\`.`, `\`${newTableName}\`.`).replaceAll(`${tableName}.`, `${newTableName}.`).replaceAll(`'${tableName}'.`, `'${newTableName}'.`)
|
24917
|
-
);
|
24918
24506
|
sqlStatements.push(
|
24919
24507
|
new SQLiteCreateTableConvertor().convert({
|
24920
24508
|
type: "sqlite_create_table",
|
24921
24509
|
tableName: newTableName,
|
24922
24510
|
columns,
|
24923
24511
|
referenceData,
|
24924
|
-
compositePKs
|
24925
|
-
checkConstraints: mappedCheckConstraints
|
24512
|
+
compositePKs
|
24926
24513
|
})
|
24927
24514
|
);
|
24928
24515
|
sqlStatements.push(
|
@@ -24953,13 +24540,10 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24953
24540
|
return statement.type === "recreate_table" && dialect7 === "turso";
|
24954
24541
|
}
|
24955
24542
|
convert(statement) {
|
24956
|
-
const { tableName, columns, compositePKs, referenceData
|
24543
|
+
const { tableName, columns, compositePKs, referenceData } = statement;
|
24957
24544
|
const columnNames = columns.map((it) => `"${it.name}"`).join(", ");
|
24958
24545
|
const newTableName = `__new_${tableName}`;
|
24959
24546
|
const sqlStatements = [];
|
24960
|
-
const mappedCheckConstraints = checkConstraints.map(
|
24961
|
-
(it) => it.replaceAll(`"${tableName}".`, `"${newTableName}".`).replaceAll(`\`${tableName}\`.`, `\`${newTableName}\`.`).replaceAll(`${tableName}.`, `${newTableName}.`).replaceAll(`'${tableName}'.`, `\`${newTableName}\`.`)
|
24962
|
-
);
|
24963
24547
|
sqlStatements.push(`PRAGMA foreign_keys=OFF;`);
|
24964
24548
|
sqlStatements.push(
|
24965
24549
|
new SQLiteCreateTableConvertor().convert({
|
@@ -24967,8 +24551,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24967
24551
|
tableName: newTableName,
|
24968
24552
|
columns,
|
24969
24553
|
referenceData,
|
24970
|
-
compositePKs
|
24971
|
-
checkConstraints: mappedCheckConstraints
|
24554
|
+
compositePKs
|
24972
24555
|
})
|
24973
24556
|
);
|
24974
24557
|
sqlStatements.push(
|
@@ -25024,10 +24607,6 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
25024
24607
|
convertors.push(new PgAlterTableAlterColumnSetTypeConvertor());
|
25025
24608
|
convertors.push(new PgAlterTableAddUniqueConstraintConvertor());
|
25026
24609
|
convertors.push(new PgAlterTableDropUniqueConstraintConvertor());
|
25027
|
-
convertors.push(new PgAlterTableAddCheckConstraintConvertor());
|
25028
|
-
convertors.push(new PgAlterTableDeleteCheckConstraintConvertor());
|
25029
|
-
convertors.push(new MySqlAlterTableAddCheckConstraintConvertor());
|
25030
|
-
convertors.push(new MySqlAlterTableDeleteCheckConstraintConvertor());
|
25031
24610
|
convertors.push(new MySQLAlterTableAddUniqueConstraintConvertor());
|
25032
24611
|
convertors.push(new MySQLAlterTableDropUniqueConstraintConvertor());
|
25033
24612
|
convertors.push(new CreatePgIndexConvertor());
|
@@ -25119,10 +24698,6 @@ var init_sqlitePushUtils = __esm({
|
|
25119
24698
|
const compositePKs = Object.values(
|
25120
24699
|
json.tables[tableName].compositePrimaryKeys
|
25121
24700
|
).map((it) => SQLiteSquasher.unsquashPK(it));
|
25122
|
-
const checkConstraints = Object.values(json.tables[tableName].checkConstraints);
|
25123
|
-
const mappedCheckConstraints = checkConstraints.map(
|
25124
|
-
(it) => it.replaceAll(`"${tableName}".`, `"${newTableName}".`).replaceAll(`\`${tableName}\`.`, `\`${newTableName}\`.`).replaceAll(`${tableName}.`, `${newTableName}.`).replaceAll(`'${tableName}'.`, `\`${newTableName}\`.`)
|
25125
|
-
);
|
25126
24701
|
const fks = referenceData.map((it) => SQLiteSquasher.unsquashPushFK(it));
|
25127
24702
|
statements.push(
|
25128
24703
|
new SQLiteCreateTableConvertor().convert({
|
@@ -25130,8 +24705,7 @@ var init_sqlitePushUtils = __esm({
|
|
25130
24705
|
tableName: newTableName,
|
25131
24706
|
columns: tableColumns,
|
25132
24707
|
referenceData: fks,
|
25133
|
-
compositePKs
|
25134
|
-
checkConstraints: mappedCheckConstraints
|
24708
|
+
compositePKs
|
25135
24709
|
})
|
25136
24710
|
);
|
25137
24711
|
if (!dataLoss) {
|
@@ -25343,7 +24917,7 @@ var init_sqlitePushUtils = __esm({
|
|
25343
24917
|
});
|
25344
24918
|
|
25345
24919
|
// src/jsonStatements.ts
|
25346
|
-
var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, prepareDropEnumJson, prepareMoveEnumJson, prepareRenameEnumJson, prepareCreateSequenceJson, prepareAlterSequenceJson, prepareDropSequenceJson, prepareMoveSequenceJson, prepareRenameSequenceJson, prepareCreateSchemasJson, prepareRenameSchemasJson, prepareDeleteSchemasJson, prepareRenameColumns, _prepareDropColumns, _prepareAddColumns, _prepareSqliteAddColumns, prepareAlterColumnsMysql, preparePgAlterColumns, prepareSqliteAlterColumns, preparePgCreateIndexesJson, prepareCreateIndexesJson, prepareCreateReferencesJson, prepareLibSQLCreateReferencesJson, prepareDropReferencesJson, prepareLibSQLDropReferencesJson, prepareAlterReferencesJson, prepareDropIndexesJson, prepareAddCompositePrimaryKeySqlite, prepareDeleteCompositePrimaryKeySqlite, prepareAlterCompositePrimaryKeySqlite, prepareAddCompositePrimaryKeyPg, prepareDeleteCompositePrimaryKeyPg, prepareAlterCompositePrimaryKeyPg, prepareAddUniqueConstraintPg, prepareDeleteUniqueConstraintPg,
|
24920
|
+
var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, prepareDropEnumJson, prepareMoveEnumJson, prepareRenameEnumJson, prepareCreateSequenceJson, prepareAlterSequenceJson, prepareDropSequenceJson, prepareMoveSequenceJson, prepareRenameSequenceJson, prepareCreateSchemasJson, prepareRenameSchemasJson, prepareDeleteSchemasJson, prepareRenameColumns, _prepareDropColumns, _prepareAddColumns, _prepareSqliteAddColumns, prepareAlterColumnsMysql, preparePgAlterColumns, prepareSqliteAlterColumns, preparePgCreateIndexesJson, prepareCreateIndexesJson, prepareCreateReferencesJson, prepareLibSQLCreateReferencesJson, prepareDropReferencesJson, prepareLibSQLDropReferencesJson, prepareAlterReferencesJson, prepareDropIndexesJson, prepareAddCompositePrimaryKeySqlite, prepareDeleteCompositePrimaryKeySqlite, prepareAlterCompositePrimaryKeySqlite, prepareAddCompositePrimaryKeyPg, prepareDeleteCompositePrimaryKeyPg, prepareAlterCompositePrimaryKeyPg, prepareAddUniqueConstraintPg, prepareDeleteUniqueConstraintPg, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql;
|
25347
24921
|
var init_jsonStatements = __esm({
|
25348
24922
|
"src/jsonStatements.ts"() {
|
25349
24923
|
"use strict";
|
@@ -25354,7 +24928,7 @@ var init_jsonStatements = __esm({
|
|
25354
24928
|
init_pgSchema();
|
25355
24929
|
init_sqliteSchema();
|
25356
24930
|
preparePgCreateTableJson = (table4, json2) => {
|
25357
|
-
const { name, schema: schema5, columns, compositePrimaryKeys, uniqueConstraints
|
24931
|
+
const { name, schema: schema5, columns, compositePrimaryKeys, uniqueConstraints } = table4;
|
25358
24932
|
const tableKey2 = `${schema5 || "public"}.${name}`;
|
25359
24933
|
const compositePkName = Object.values(compositePrimaryKeys).length > 0 ? json2.tables[tableKey2].compositePrimaryKeys[`${PgSquasher.unsquashPK(Object.values(compositePrimaryKeys)[0]).name}`].name : "";
|
25360
24934
|
return {
|
@@ -25364,12 +24938,11 @@ var init_jsonStatements = __esm({
|
|
25364
24938
|
columns: Object.values(columns),
|
25365
24939
|
compositePKs: Object.values(compositePrimaryKeys),
|
25366
24940
|
compositePkName,
|
25367
|
-
uniqueConstraints: Object.values(uniqueConstraints)
|
25368
|
-
checkConstraints: Object.values(checkConstraints)
|
24941
|
+
uniqueConstraints: Object.values(uniqueConstraints)
|
25369
24942
|
};
|
25370
24943
|
};
|
25371
24944
|
prepareMySqlCreateTableJson = (table4, json2, internals) => {
|
25372
|
-
const { name, schema: schema5, columns, compositePrimaryKeys, uniqueConstraints
|
24945
|
+
const { name, schema: schema5, columns, compositePrimaryKeys, uniqueConstraints } = table4;
|
25373
24946
|
return {
|
25374
24947
|
type: "create_table",
|
25375
24948
|
tableName: name,
|
@@ -25378,12 +24951,11 @@ var init_jsonStatements = __esm({
|
|
25378
24951
|
compositePKs: Object.values(compositePrimaryKeys),
|
25379
24952
|
compositePkName: Object.values(compositePrimaryKeys).length > 0 ? json2.tables[name].compositePrimaryKeys[MySqlSquasher.unsquashPK(Object.values(compositePrimaryKeys)[0]).name].name : "",
|
25380
24953
|
uniqueConstraints: Object.values(uniqueConstraints),
|
25381
|
-
internals
|
25382
|
-
checkConstraints: Object.values(checkConstraints)
|
24954
|
+
internals
|
25383
24955
|
};
|
25384
24956
|
};
|
25385
24957
|
prepareSQLiteCreateTable = (table4, action) => {
|
25386
|
-
const { name, columns, uniqueConstraints
|
24958
|
+
const { name, columns, uniqueConstraints } = table4;
|
25387
24959
|
const references2 = Object.values(table4.foreignKeys);
|
25388
24960
|
const composites = Object.values(table4.compositePrimaryKeys).map(
|
25389
24961
|
(it) => SQLiteSquasher.unsquashPK(it)
|
@@ -25397,8 +24969,7 @@ var init_jsonStatements = __esm({
|
|
25397
24969
|
columns: Object.values(columns),
|
25398
24970
|
referenceData: fks,
|
25399
24971
|
compositePKs: composites,
|
25400
|
-
uniqueConstraints: Object.values(uniqueConstraints)
|
25401
|
-
checkConstraints: Object.values(checkConstraints)
|
24972
|
+
uniqueConstraints: Object.values(uniqueConstraints)
|
25402
24973
|
};
|
25403
24974
|
};
|
25404
24975
|
prepareDropTableJson = (table4) => {
|
@@ -26646,26 +26217,6 @@ var init_jsonStatements = __esm({
|
|
26646
26217
|
};
|
26647
26218
|
});
|
26648
26219
|
};
|
26649
|
-
prepareAddCheckConstraint = (tableName, schema5, check2) => {
|
26650
|
-
return Object.values(check2).map((it) => {
|
26651
|
-
return {
|
26652
|
-
type: "create_check_constraint",
|
26653
|
-
tableName,
|
26654
|
-
data: it,
|
26655
|
-
schema: schema5
|
26656
|
-
};
|
26657
|
-
});
|
26658
|
-
};
|
26659
|
-
prepareDeleteCheckConstraint = (tableName, schema5, check2) => {
|
26660
|
-
return Object.values(check2).map((it) => {
|
26661
|
-
return {
|
26662
|
-
type: "delete_check_constraint",
|
26663
|
-
tableName,
|
26664
|
-
constraintName: PgSquasher.unsquashCheck(it).name,
|
26665
|
-
schema: schema5
|
26666
|
-
};
|
26667
|
-
});
|
26668
|
-
};
|
26669
26220
|
prepareAddCompositePrimaryKeyMySql = (tableName, pks, json1, json2) => {
|
26670
26221
|
var _a, _b;
|
26671
26222
|
const res = [];
|
@@ -26716,7 +26267,7 @@ var init_statementCombiner = __esm({
|
|
26716
26267
|
init_jsonStatements();
|
26717
26268
|
init_sqliteSchema();
|
26718
26269
|
prepareLibSQLRecreateTable = (table4, action) => {
|
26719
|
-
const { name, columns, uniqueConstraints, indexes
|
26270
|
+
const { name, columns, uniqueConstraints, indexes } = table4;
|
26720
26271
|
const composites = Object.values(table4.compositePrimaryKeys).map(
|
26721
26272
|
(it) => SQLiteSquasher.unsquashPK(it)
|
26722
26273
|
);
|
@@ -26731,8 +26282,7 @@ var init_statementCombiner = __esm({
|
|
26731
26282
|
columns: Object.values(columns),
|
26732
26283
|
compositePKs: composites,
|
26733
26284
|
referenceData: fks,
|
26734
|
-
uniqueConstraints: Object.values(uniqueConstraints)
|
26735
|
-
checkConstraints: Object.values(checkConstraints)
|
26285
|
+
uniqueConstraints: Object.values(uniqueConstraints)
|
26736
26286
|
}
|
26737
26287
|
];
|
26738
26288
|
if (Object.keys(indexes).length) {
|
@@ -26741,7 +26291,7 @@ var init_statementCombiner = __esm({
|
|
26741
26291
|
return statements;
|
26742
26292
|
};
|
26743
26293
|
prepareSQLiteRecreateTable = (table4, action) => {
|
26744
|
-
const { name, columns, uniqueConstraints, indexes
|
26294
|
+
const { name, columns, uniqueConstraints, indexes } = table4;
|
26745
26295
|
const composites = Object.values(table4.compositePrimaryKeys).map(
|
26746
26296
|
(it) => SQLiteSquasher.unsquashPK(it)
|
26747
26297
|
);
|
@@ -26756,8 +26306,7 @@ var init_statementCombiner = __esm({
|
|
26756
26306
|
columns: Object.values(columns),
|
26757
26307
|
compositePKs: composites,
|
26758
26308
|
referenceData: fks,
|
26759
|
-
uniqueConstraints: Object.values(uniqueConstraints)
|
26760
|
-
checkConstraints: Object.values(checkConstraints)
|
26309
|
+
uniqueConstraints: Object.values(uniqueConstraints)
|
26761
26310
|
}
|
26762
26311
|
];
|
26763
26312
|
if (Object.keys(indexes).length) {
|
@@ -26768,7 +26317,7 @@ var init_statementCombiner = __esm({
|
|
26768
26317
|
libSQLCombineStatements = (statements, json2, action) => {
|
26769
26318
|
const newStatements = {};
|
26770
26319
|
for (const statement of statements) {
|
26771
|
-
if (statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_pk" || statement.type === "alter_table_alter_column_set_pk" || statement.type === "create_composite_pk" || statement.type === "alter_composite_pk" || statement.type === "delete_composite_pk"
|
26320
|
+
if (statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_pk" || statement.type === "alter_table_alter_column_set_pk" || statement.type === "create_composite_pk" || statement.type === "alter_composite_pk" || statement.type === "delete_composite_pk") {
|
26772
26321
|
const tableName2 = statement.tableName;
|
26773
26322
|
const statementsForTable2 = newStatements[tableName2];
|
26774
26323
|
if (!statementsForTable2) {
|
@@ -26909,16 +26458,16 @@ var init_statementCombiner = __esm({
|
|
26909
26458
|
sqliteCombineStatements = (statements, json2, action) => {
|
26910
26459
|
const newStatements = {};
|
26911
26460
|
for (const statement of statements) {
|
26912
|
-
if (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_pk" || statement.type === "alter_table_alter_column_set_pk" || statement.type === "delete_reference" || statement.type === "alter_reference" || statement.type === "create_composite_pk" || statement.type === "alter_composite_pk" || statement.type === "delete_composite_pk" || statement.type === "create_unique_constraint" || statement.type === "delete_unique_constraint"
|
26461
|
+
if (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_pk" || statement.type === "alter_table_alter_column_set_pk" || statement.type === "delete_reference" || statement.type === "alter_reference" || statement.type === "create_composite_pk" || statement.type === "alter_composite_pk" || statement.type === "delete_composite_pk" || statement.type === "create_unique_constraint" || statement.type === "delete_unique_constraint") {
|
26913
26462
|
const tableName2 = statement.tableName;
|
26914
26463
|
const statementsForTable2 = newStatements[tableName2];
|
26915
26464
|
if (!statementsForTable2) {
|
26916
|
-
newStatements[tableName2] =
|
26465
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
26917
26466
|
continue;
|
26918
26467
|
}
|
26919
26468
|
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
26920
26469
|
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
26921
|
-
const preparedStatements =
|
26470
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
26922
26471
|
if (wasRename) {
|
26923
26472
|
newStatements[tableName2].push(...preparedStatements);
|
26924
26473
|
} else {
|
@@ -26932,12 +26481,12 @@ var init_statementCombiner = __esm({
|
|
26932
26481
|
const tableName2 = statement.tableName;
|
26933
26482
|
const statementsForTable2 = newStatements[tableName2];
|
26934
26483
|
if (!statementsForTable2) {
|
26935
|
-
newStatements[tableName2] =
|
26484
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
26936
26485
|
continue;
|
26937
26486
|
}
|
26938
26487
|
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
26939
26488
|
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
26940
|
-
const preparedStatements =
|
26489
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
26941
26490
|
if (wasRename) {
|
26942
26491
|
newStatements[tableName2].push(...preparedStatements);
|
26943
26492
|
} else {
|
@@ -26962,7 +26511,7 @@ var init_statementCombiner = __esm({
|
|
26962
26511
|
}
|
26963
26512
|
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
26964
26513
|
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
26965
|
-
const preparedStatements =
|
26514
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
26966
26515
|
if (wasRename) {
|
26967
26516
|
newStatements[tableName2].push(...preparedStatements);
|
26968
26517
|
} else {
|
@@ -27097,8 +26646,7 @@ var init_snapshotsDiffer = __esm({
|
|
27097
26646
|
indexes: recordType(stringType(), stringType()),
|
27098
26647
|
foreignKeys: recordType(stringType(), stringType()),
|
27099
26648
|
compositePrimaryKeys: recordType(stringType(), stringType()).default({}),
|
27100
|
-
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
27101
|
-
checkConstraints: recordType(stringType(), stringType()).default({})
|
26649
|
+
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
27102
26650
|
}).strict();
|
27103
26651
|
alteredTableScheme = objectType({
|
27104
26652
|
name: stringType(),
|
@@ -27139,21 +26687,6 @@ var init_snapshotsDiffer = __esm({
|
|
27139
26687
|
__new: stringType(),
|
27140
26688
|
__old: stringType()
|
27141
26689
|
})
|
27142
|
-
),
|
27143
|
-
addedCheckConstraints: recordType(
|
27144
|
-
stringType(),
|
27145
|
-
stringType()
|
27146
|
-
),
|
27147
|
-
deletedCheckConstraints: recordType(
|
27148
|
-
stringType(),
|
27149
|
-
stringType()
|
27150
|
-
),
|
27151
|
-
alteredCheckConstraints: recordType(
|
27152
|
-
stringType(),
|
27153
|
-
objectType({
|
27154
|
-
__new: stringType(),
|
27155
|
-
__old: stringType()
|
27156
|
-
})
|
27157
26690
|
)
|
27158
26691
|
}).strict();
|
27159
26692
|
diffResultScheme = objectType({
|
@@ -27494,8 +27027,6 @@ var init_snapshotsDiffer = __esm({
|
|
27494
27027
|
schemaTo: it.schemaTo || "public"
|
27495
27028
|
});
|
27496
27029
|
}
|
27497
|
-
const jsonDeletedCheckConstraints = [];
|
27498
|
-
const jsonCreatedCheckConstraints = [];
|
27499
27030
|
for (let it of alteredTables) {
|
27500
27031
|
let addedColumns = [];
|
27501
27032
|
for (const addedPkName of Object.keys(it.addedCompositePKs)) {
|
@@ -27535,8 +27066,6 @@ var init_snapshotsDiffer = __esm({
|
|
27535
27066
|
let addedUniqueConstraints = [];
|
27536
27067
|
let deletedUniqueConstraints = [];
|
27537
27068
|
let alteredUniqueConstraints = [];
|
27538
|
-
let createCheckConstraints = [];
|
27539
|
-
let deleteCheckConstraints = [];
|
27540
27069
|
addedUniqueConstraints = prepareAddUniqueConstraintPg(
|
27541
27070
|
it.name,
|
27542
27071
|
it.schema,
|
@@ -27561,24 +27090,6 @@ var init_snapshotsDiffer = __esm({
|
|
27561
27090
|
...prepareDeleteUniqueConstraintPg(it.name, it.schema, deleted)
|
27562
27091
|
);
|
27563
27092
|
}
|
27564
|
-
createCheckConstraints = prepareAddCheckConstraint(it.name, it.schema, it.addedCheckConstraints);
|
27565
|
-
deleteCheckConstraints = prepareDeleteCheckConstraint(
|
27566
|
-
it.name,
|
27567
|
-
it.schema,
|
27568
|
-
it.deletedCheckConstraints
|
27569
|
-
);
|
27570
|
-
if (it.alteredCheckConstraints && action !== "push") {
|
27571
|
-
const added = {};
|
27572
|
-
const deleted = {};
|
27573
|
-
for (const k of Object.keys(it.alteredCheckConstraints)) {
|
27574
|
-
added[k] = it.alteredCheckConstraints[k].__new;
|
27575
|
-
deleted[k] = it.alteredCheckConstraints[k].__old;
|
27576
|
-
}
|
27577
|
-
createCheckConstraints.push(...prepareAddCheckConstraint(it.name, it.schema, added));
|
27578
|
-
deleteCheckConstraints.push(...prepareDeleteCheckConstraint(it.name, it.schema, deleted));
|
27579
|
-
}
|
27580
|
-
jsonCreatedCheckConstraints.push(...createCheckConstraints);
|
27581
|
-
jsonDeletedCheckConstraints.push(...deleteCheckConstraints);
|
27582
27093
|
jsonAddedCompositePKs.push(...addedCompositePKs);
|
27583
27094
|
jsonDeletedCompositePKs.push(...deletedCompositePKs);
|
27584
27095
|
jsonAlteredCompositePKs.push(...alteredCompositePKs);
|
@@ -27732,7 +27243,6 @@ var init_snapshotsDiffer = __esm({
|
|
27732
27243
|
jsonStatements.push(...jsonRenameTables);
|
27733
27244
|
jsonStatements.push(...jsonRenameColumnsStatements);
|
27734
27245
|
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
27735
|
-
jsonStatements.push(...jsonDeletedCheckConstraints);
|
27736
27246
|
jsonStatements.push(...jsonDroppedReferencesForAlteredTables);
|
27737
27247
|
jsonStatements.push(...jsonDropIndexesForAllAlteredTables);
|
27738
27248
|
jsonStatements.push(...jsonDeletedCompositePKs);
|
@@ -27746,7 +27256,6 @@ var init_snapshotsDiffer = __esm({
|
|
27746
27256
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
27747
27257
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
27748
27258
|
jsonStatements.push(...jsonAddedUniqueConstraints);
|
27749
|
-
jsonStatements.push(...jsonCreatedCheckConstraints);
|
27750
27259
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
27751
27260
|
jsonStatements.push(...dropEnums);
|
27752
27261
|
jsonStatements.push(...dropSequences);
|
@@ -27910,8 +27419,6 @@ var init_snapshotsDiffer = __esm({
|
|
27910
27419
|
const jsonAddedUniqueConstraints = [];
|
27911
27420
|
const jsonDeletedUniqueConstraints = [];
|
27912
27421
|
const jsonAlteredUniqueConstraints = [];
|
27913
|
-
const jsonCreatedCheckConstraints = [];
|
27914
|
-
const jsonDeletedCheckConstraints = [];
|
27915
27422
|
const jsonRenameColumnsStatements = columnRenames.map((it) => prepareRenameColumns(it.table, "", it.renames)).flat();
|
27916
27423
|
const jsonAddColumnsStatemets = columnCreates.map((it) => _prepareAddColumns(it.table, "", it.columns)).flat();
|
27917
27424
|
const jsonDropColumnsStatemets = columnDeletes.map((it) => _prepareDropColumns(it.table, "", it.columns)).flat();
|
@@ -27950,8 +27457,6 @@ var init_snapshotsDiffer = __esm({
|
|
27950
27457
|
let addedUniqueConstraints = [];
|
27951
27458
|
let deletedUniqueConstraints = [];
|
27952
27459
|
let alteredUniqueConstraints = [];
|
27953
|
-
let createdCheckConstraints = [];
|
27954
|
-
let deletedCheckConstraints = [];
|
27955
27460
|
addedUniqueConstraints = prepareAddUniqueConstraintPg(
|
27956
27461
|
it.name,
|
27957
27462
|
it.schema,
|
@@ -27976,30 +27481,12 @@ var init_snapshotsDiffer = __esm({
|
|
27976
27481
|
...prepareDeleteUniqueConstraintPg(it.name, it.schema, deleted)
|
27977
27482
|
);
|
27978
27483
|
}
|
27979
|
-
createdCheckConstraints = prepareAddCheckConstraint(it.name, it.schema, it.addedCheckConstraints);
|
27980
|
-
deletedCheckConstraints = prepareDeleteCheckConstraint(
|
27981
|
-
it.name,
|
27982
|
-
it.schema,
|
27983
|
-
it.deletedCheckConstraints
|
27984
|
-
);
|
27985
|
-
if (it.alteredCheckConstraints && action !== "push") {
|
27986
|
-
const added = {};
|
27987
|
-
const deleted = {};
|
27988
|
-
for (const k of Object.keys(it.alteredCheckConstraints)) {
|
27989
|
-
added[k] = it.alteredCheckConstraints[k].__new;
|
27990
|
-
deleted[k] = it.alteredCheckConstraints[k].__old;
|
27991
|
-
}
|
27992
|
-
createdCheckConstraints.push(...prepareAddCheckConstraint(it.name, it.schema, added));
|
27993
|
-
deletedCheckConstraints.push(...prepareDeleteCheckConstraint(it.name, it.schema, deleted));
|
27994
|
-
}
|
27995
27484
|
jsonAddedCompositePKs.push(...addedCompositePKs);
|
27996
27485
|
jsonDeletedCompositePKs.push(...deletedCompositePKs);
|
27997
27486
|
jsonAlteredCompositePKs.push(...alteredCompositePKs);
|
27998
27487
|
jsonAddedUniqueConstraints.push(...addedUniqueConstraints);
|
27999
27488
|
jsonDeletedUniqueConstraints.push(...deletedUniqueConstraints);
|
28000
27489
|
jsonAlteredUniqueConstraints.push(...alteredUniqueConstraints);
|
28001
|
-
jsonCreatedCheckConstraints.push(...createdCheckConstraints);
|
28002
|
-
jsonDeletedCheckConstraints.push(...deletedCheckConstraints);
|
28003
27490
|
});
|
28004
27491
|
const rColumns = jsonRenameColumnsStatements.map((it) => {
|
28005
27492
|
const tableName = it.tableName;
|
@@ -28095,7 +27582,6 @@ var init_snapshotsDiffer = __esm({
|
|
28095
27582
|
jsonStatements.push(...jsonRenameTables);
|
28096
27583
|
jsonStatements.push(...jsonRenameColumnsStatements);
|
28097
27584
|
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
28098
|
-
jsonStatements.push(...jsonDeletedCheckConstraints);
|
28099
27585
|
jsonStatements.push(...jsonDroppedReferencesForAlteredTables);
|
28100
27586
|
jsonStatements.push(...jsonDropIndexesForAllAlteredTables);
|
28101
27587
|
jsonStatements.push(...jsonDeletedCompositePKs);
|
@@ -28106,11 +27592,11 @@ var init_snapshotsDiffer = __esm({
|
|
28106
27592
|
jsonStatements.push(...jsonAddColumnsStatemets);
|
28107
27593
|
jsonStatements.push(...jsonCreateReferencesForCreatedTables);
|
28108
27594
|
jsonStatements.push(...jsonCreateIndexesForCreatedTables);
|
28109
|
-
jsonStatements.push(...jsonCreatedCheckConstraints);
|
28110
27595
|
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
28111
27596
|
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
28112
27597
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
28113
27598
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
27599
|
+
jsonStatements.push(...jsonAddedUniqueConstraints);
|
28114
27600
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
28115
27601
|
const sqlStatements = fromJson(jsonStatements, "mysql");
|
28116
27602
|
const uniqueSqlStatements = [];
|
@@ -28238,8 +27724,6 @@ var init_snapshotsDiffer = __esm({
|
|
28238
27724
|
const jsonAddedUniqueConstraints = [];
|
28239
27725
|
const jsonDeletedUniqueConstraints = [];
|
28240
27726
|
const jsonAlteredUniqueConstraints = [];
|
28241
|
-
const jsonDeletedCheckConstraints = [];
|
28242
|
-
const jsonCreatedCheckConstraints = [];
|
28243
27727
|
allAltered.forEach((it) => {
|
28244
27728
|
let addedColumns = [];
|
28245
27729
|
for (const addedPkName of Object.keys(it.addedCompositePKs)) {
|
@@ -28296,56 +27780,12 @@ var init_snapshotsDiffer = __esm({
|
|
28296
27780
|
...prepareDeleteUniqueConstraintPg(it.name, it.schema, deleted)
|
28297
27781
|
);
|
28298
27782
|
}
|
28299
|
-
let createdCheckConstraints = [];
|
28300
|
-
let deletedCheckConstraints = [];
|
28301
|
-
addedUniqueConstraints = prepareAddUniqueConstraintPg(
|
28302
|
-
it.name,
|
28303
|
-
it.schema,
|
28304
|
-
it.addedUniqueConstraints
|
28305
|
-
);
|
28306
|
-
deletedUniqueConstraints = prepareDeleteUniqueConstraintPg(
|
28307
|
-
it.name,
|
28308
|
-
it.schema,
|
28309
|
-
it.deletedUniqueConstraints
|
28310
|
-
);
|
28311
|
-
if (it.alteredUniqueConstraints) {
|
28312
|
-
const added = {};
|
28313
|
-
const deleted = {};
|
28314
|
-
for (const k of Object.keys(it.alteredUniqueConstraints)) {
|
28315
|
-
added[k] = it.alteredUniqueConstraints[k].__new;
|
28316
|
-
deleted[k] = it.alteredUniqueConstraints[k].__old;
|
28317
|
-
}
|
28318
|
-
addedUniqueConstraints.push(
|
28319
|
-
...prepareAddUniqueConstraintPg(it.name, it.schema, added)
|
28320
|
-
);
|
28321
|
-
deletedUniqueConstraints.push(
|
28322
|
-
...prepareDeleteUniqueConstraintPg(it.name, it.schema, deleted)
|
28323
|
-
);
|
28324
|
-
}
|
28325
|
-
createdCheckConstraints = prepareAddCheckConstraint(it.name, it.schema, it.addedCheckConstraints);
|
28326
|
-
deletedCheckConstraints = prepareDeleteCheckConstraint(
|
28327
|
-
it.name,
|
28328
|
-
it.schema,
|
28329
|
-
it.deletedCheckConstraints
|
28330
|
-
);
|
28331
|
-
if (it.alteredCheckConstraints && action !== "push") {
|
28332
|
-
const added = {};
|
28333
|
-
const deleted = {};
|
28334
|
-
for (const k of Object.keys(it.alteredCheckConstraints)) {
|
28335
|
-
added[k] = it.alteredCheckConstraints[k].__new;
|
28336
|
-
deleted[k] = it.alteredCheckConstraints[k].__old;
|
28337
|
-
}
|
28338
|
-
createdCheckConstraints.push(...prepareAddCheckConstraint(it.name, it.schema, added));
|
28339
|
-
deletedCheckConstraints.push(...prepareDeleteCheckConstraint(it.name, it.schema, deleted));
|
28340
|
-
}
|
28341
27783
|
jsonAddedCompositePKs.push(...addedCompositePKs);
|
28342
27784
|
jsonDeletedCompositePKs.push(...deletedCompositePKs);
|
28343
27785
|
jsonAlteredCompositePKs.push(...alteredCompositePKs);
|
28344
27786
|
jsonAddedUniqueConstraints.push(...addedUniqueConstraints);
|
28345
27787
|
jsonDeletedUniqueConstraints.push(...deletedUniqueConstraints);
|
28346
27788
|
jsonAlteredUniqueConstraints.push(...alteredUniqueConstraints);
|
28347
|
-
jsonCreatedCheckConstraints.push(...createdCheckConstraints);
|
28348
|
-
jsonDeletedCheckConstraints.push(...deletedCheckConstraints);
|
28349
27789
|
});
|
28350
27790
|
const rColumns = jsonRenameColumnsStatements.map((it) => {
|
28351
27791
|
const tableName = it.tableName;
|
@@ -28430,7 +27870,6 @@ var init_snapshotsDiffer = __esm({
|
|
28430
27870
|
jsonStatements.push(...jsonRenameTables);
|
28431
27871
|
jsonStatements.push(...jsonRenameColumnsStatements);
|
28432
27872
|
jsonStatements.push(...jsonDroppedReferencesForAlteredTables);
|
28433
|
-
jsonStatements.push(...jsonDeletedCheckConstraints);
|
28434
27873
|
jsonStatements.push(...jsonDropIndexesForAllAlteredTables);
|
28435
27874
|
jsonStatements.push(...jsonDeletedCompositePKs);
|
28436
27875
|
jsonStatements.push(...jsonTableAlternations);
|
@@ -28438,7 +27877,6 @@ var init_snapshotsDiffer = __esm({
|
|
28438
27877
|
jsonStatements.push(...jsonAddColumnsStatemets);
|
28439
27878
|
jsonStatements.push(...jsonCreateIndexesForCreatedTables);
|
28440
27879
|
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
28441
|
-
jsonStatements.push(...jsonCreatedCheckConstraints);
|
28442
27880
|
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
28443
27881
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
28444
27882
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
@@ -28582,8 +28020,6 @@ var init_snapshotsDiffer = __esm({
|
|
28582
28020
|
const jsonAddedUniqueConstraints = [];
|
28583
28021
|
const jsonDeletedUniqueConstraints = [];
|
28584
28022
|
const jsonAlteredUniqueConstraints = [];
|
28585
|
-
const jsonDeletedCheckConstraints = [];
|
28586
|
-
const jsonCreatedCheckConstraints = [];
|
28587
28023
|
allAltered.forEach((it) => {
|
28588
28024
|
let addedColumns = [];
|
28589
28025
|
for (const addedPkName of Object.keys(it.addedCompositePKs)) {
|
@@ -28616,8 +28052,6 @@ var init_snapshotsDiffer = __esm({
|
|
28616
28052
|
let addedUniqueConstraints = [];
|
28617
28053
|
let deletedUniqueConstraints = [];
|
28618
28054
|
let alteredUniqueConstraints = [];
|
28619
|
-
let createdCheckConstraints = [];
|
28620
|
-
let deletedCheckConstraints = [];
|
28621
28055
|
addedUniqueConstraints = prepareAddUniqueConstraintPg(
|
28622
28056
|
it.name,
|
28623
28057
|
it.schema,
|
@@ -28642,30 +28076,12 @@ var init_snapshotsDiffer = __esm({
|
|
28642
28076
|
...prepareDeleteUniqueConstraintPg(it.name, it.schema, deleted)
|
28643
28077
|
);
|
28644
28078
|
}
|
28645
|
-
createdCheckConstraints = prepareAddCheckConstraint(it.name, it.schema, it.addedCheckConstraints);
|
28646
|
-
deletedCheckConstraints = prepareDeleteCheckConstraint(
|
28647
|
-
it.name,
|
28648
|
-
it.schema,
|
28649
|
-
it.deletedCheckConstraints
|
28650
|
-
);
|
28651
|
-
if (it.alteredCheckConstraints && action !== "push") {
|
28652
|
-
const added = {};
|
28653
|
-
const deleted = {};
|
28654
|
-
for (const k of Object.keys(it.alteredCheckConstraints)) {
|
28655
|
-
added[k] = it.alteredCheckConstraints[k].__new;
|
28656
|
-
deleted[k] = it.alteredCheckConstraints[k].__old;
|
28657
|
-
}
|
28658
|
-
createdCheckConstraints.push(...prepareAddCheckConstraint(it.name, it.schema, added));
|
28659
|
-
deletedCheckConstraints.push(...prepareDeleteCheckConstraint(it.name, it.schema, deleted));
|
28660
|
-
}
|
28661
28079
|
jsonAddedCompositePKs.push(...addedCompositePKs);
|
28662
28080
|
jsonDeletedCompositePKs.push(...deletedCompositePKs);
|
28663
28081
|
jsonAlteredCompositePKs.push(...alteredCompositePKs);
|
28664
28082
|
jsonAddedUniqueConstraints.push(...addedUniqueConstraints);
|
28665
28083
|
jsonDeletedUniqueConstraints.push(...deletedUniqueConstraints);
|
28666
28084
|
jsonAlteredUniqueConstraints.push(...alteredUniqueConstraints);
|
28667
|
-
jsonCreatedCheckConstraints.push(...createdCheckConstraints);
|
28668
|
-
jsonDeletedCheckConstraints.push(...deletedCheckConstraints);
|
28669
28085
|
});
|
28670
28086
|
const jsonTableAlternations = allAltered.map((it) => {
|
28671
28087
|
return prepareSqliteAlterColumns(it.name, it.schema, it.altered, json2);
|
@@ -28743,7 +28159,6 @@ var init_snapshotsDiffer = __esm({
|
|
28743
28159
|
jsonStatements.push(...jsonRenameTables);
|
28744
28160
|
jsonStatements.push(...jsonRenameColumnsStatements);
|
28745
28161
|
jsonStatements.push(...jsonDroppedReferencesForAlteredTables);
|
28746
|
-
jsonStatements.push(...jsonDeletedCheckConstraints);
|
28747
28162
|
jsonStatements.push(...jsonDropIndexesForAllAlteredTables);
|
28748
28163
|
jsonStatements.push(...jsonDeletedCompositePKs);
|
28749
28164
|
jsonStatements.push(...jsonTableAlternations);
|
@@ -28751,7 +28166,6 @@ var init_snapshotsDiffer = __esm({
|
|
28751
28166
|
jsonStatements.push(...jsonAddColumnsStatemets);
|
28752
28167
|
jsonStatements.push(...jsonCreateIndexesForCreatedTables);
|
28753
28168
|
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
28754
|
-
jsonStatements.push(...jsonCreatedCheckConstraints);
|
28755
28169
|
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
28756
28170
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
28757
28171
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
@@ -56820,9 +56234,9 @@ var require_dist_cjs46 = __commonJS({
|
|
56820
56234
|
}
|
56821
56235
|
});
|
56822
56236
|
|
56823
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56237
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/auth/httpAuthSchemeProvider.js
|
56824
56238
|
var require_httpAuthSchemeProvider3 = __commonJS({
|
56825
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56239
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) {
|
56826
56240
|
"use strict";
|
56827
56241
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
56828
56242
|
exports2.resolveHttpAuthSchemeConfig = exports2.defaultSSOOIDCHttpAuthSchemeProvider = exports2.defaultSSOOIDCHttpAuthSchemeParametersProvider = void 0;
|
@@ -56889,9 +56303,9 @@ var require_httpAuthSchemeProvider3 = __commonJS({
|
|
56889
56303
|
}
|
56890
56304
|
});
|
56891
56305
|
|
56892
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56306
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/package.json
|
56893
56307
|
var require_package4 = __commonJS({
|
56894
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56308
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/package.json"(exports2, module2) {
|
56895
56309
|
module2.exports = {
|
56896
56310
|
name: "@aws-sdk/client-sso-oidc",
|
56897
56311
|
description: "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",
|
@@ -56995,9 +56409,9 @@ var require_package4 = __commonJS({
|
|
56995
56409
|
}
|
56996
56410
|
});
|
56997
56411
|
|
56998
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56412
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js
|
56999
56413
|
var require_ruleset2 = __commonJS({
|
57000
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56414
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js"(exports2) {
|
57001
56415
|
"use strict";
|
57002
56416
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
57003
56417
|
exports2.ruleSet = void 0;
|
@@ -57030,9 +56444,9 @@ var require_ruleset2 = __commonJS({
|
|
57030
56444
|
}
|
57031
56445
|
});
|
57032
56446
|
|
57033
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56447
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js
|
57034
56448
|
var require_endpointResolver2 = __commonJS({
|
57035
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56449
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js"(exports2) {
|
57036
56450
|
"use strict";
|
57037
56451
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
57038
56452
|
exports2.defaultEndpointResolver = void 0;
|
@@ -57050,9 +56464,9 @@ var require_endpointResolver2 = __commonJS({
|
|
57050
56464
|
}
|
57051
56465
|
});
|
57052
56466
|
|
57053
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56467
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js
|
57054
56468
|
var require_runtimeConfig_shared2 = __commonJS({
|
57055
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56469
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js"(exports2) {
|
57056
56470
|
"use strict";
|
57057
56471
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
57058
56472
|
exports2.getRuntimeConfig = void 0;
|
@@ -57096,9 +56510,9 @@ var require_runtimeConfig_shared2 = __commonJS({
|
|
57096
56510
|
}
|
57097
56511
|
});
|
57098
56512
|
|
57099
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56513
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js
|
57100
56514
|
var require_runtimeConfig2 = __commonJS({
|
57101
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56515
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js"(exports2) {
|
57102
56516
|
"use strict";
|
57103
56517
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
57104
56518
|
exports2.getRuntimeConfig = void 0;
|
@@ -57149,9 +56563,9 @@ var require_runtimeConfig2 = __commonJS({
|
|
57149
56563
|
}
|
57150
56564
|
});
|
57151
56565
|
|
57152
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56566
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js
|
57153
56567
|
var require_dist_cjs47 = __commonJS({
|
57154
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.
|
56568
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js"(exports2, module2) {
|
57155
56569
|
"use strict";
|
57156
56570
|
var __defProp3 = Object.defineProperty;
|
57157
56571
|
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
@@ -58497,9 +57911,9 @@ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.ht
|
|
58497
57911
|
}
|
58498
57912
|
});
|
58499
57913
|
|
58500
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js
|
57914
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js
|
58501
57915
|
var require_httpAuthSchemeProvider4 = __commonJS({
|
58502
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) {
|
57916
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) {
|
58503
57917
|
"use strict";
|
58504
57918
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58505
57919
|
exports2.resolveHttpAuthSchemeConfig = exports2.resolveStsAuthConfig = exports2.defaultSTSHttpAuthSchemeProvider = exports2.defaultSTSHttpAuthSchemeParametersProvider = void 0;
|
@@ -58569,9 +57983,9 @@ var require_httpAuthSchemeProvider4 = __commonJS({
|
|
58569
57983
|
}
|
58570
57984
|
});
|
58571
57985
|
|
58572
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js
|
57986
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js
|
58573
57987
|
var require_EndpointParameters = __commonJS({
|
58574
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js"(exports2) {
|
57988
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js"(exports2) {
|
58575
57989
|
"use strict";
|
58576
57990
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58577
57991
|
exports2.commonParams = exports2.resolveClientEndpointParameters = void 0;
|
@@ -58595,9 +58009,9 @@ var require_EndpointParameters = __commonJS({
|
|
58595
58009
|
}
|
58596
58010
|
});
|
58597
58011
|
|
58598
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/package.json
|
58012
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/package.json
|
58599
58013
|
var require_package5 = __commonJS({
|
58600
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/package.json"(exports2, module2) {
|
58014
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/package.json"(exports2, module2) {
|
58601
58015
|
module2.exports = {
|
58602
58016
|
name: "@aws-sdk/client-sts",
|
58603
58017
|
description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",
|
@@ -58703,9 +58117,9 @@ var require_package5 = __commonJS({
|
|
58703
58117
|
}
|
58704
58118
|
});
|
58705
58119
|
|
58706
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js
|
58120
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js
|
58707
58121
|
var require_ruleset3 = __commonJS({
|
58708
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js"(exports2) {
|
58122
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js"(exports2) {
|
58709
58123
|
"use strict";
|
58710
58124
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58711
58125
|
exports2.ruleSet = void 0;
|
@@ -58750,9 +58164,9 @@ var require_ruleset3 = __commonJS({
|
|
58750
58164
|
}
|
58751
58165
|
});
|
58752
58166
|
|
58753
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js
|
58167
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js
|
58754
58168
|
var require_endpointResolver3 = __commonJS({
|
58755
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js"(exports2) {
|
58169
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js"(exports2) {
|
58756
58170
|
"use strict";
|
58757
58171
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58758
58172
|
exports2.defaultEndpointResolver = void 0;
|
@@ -58770,9 +58184,9 @@ var require_endpointResolver3 = __commonJS({
|
|
58770
58184
|
}
|
58771
58185
|
});
|
58772
58186
|
|
58773
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js
|
58187
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js
|
58774
58188
|
var require_runtimeConfig_shared3 = __commonJS({
|
58775
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js"(exports2) {
|
58189
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js"(exports2) {
|
58776
58190
|
"use strict";
|
58777
58191
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58778
58192
|
exports2.getRuntimeConfig = void 0;
|
@@ -58816,9 +58230,9 @@ var require_runtimeConfig_shared3 = __commonJS({
|
|
58816
58230
|
}
|
58817
58231
|
});
|
58818
58232
|
|
58819
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js
|
58233
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js
|
58820
58234
|
var require_runtimeConfig3 = __commonJS({
|
58821
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js"(exports2) {
|
58235
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js"(exports2) {
|
58822
58236
|
"use strict";
|
58823
58237
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58824
58238
|
exports2.getRuntimeConfig = void 0;
|
@@ -58882,9 +58296,9 @@ var require_runtimeConfig3 = __commonJS({
|
|
58882
58296
|
}
|
58883
58297
|
});
|
58884
58298
|
|
58885
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js
|
58299
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js
|
58886
58300
|
var require_httpAuthExtensionConfiguration = __commonJS({
|
58887
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js"(exports2) {
|
58301
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js"(exports2) {
|
58888
58302
|
"use strict";
|
58889
58303
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58890
58304
|
exports2.resolveHttpAuthRuntimeConfig = exports2.getHttpAuthExtensionConfiguration = void 0;
|
@@ -58930,9 +58344,9 @@ var require_httpAuthExtensionConfiguration = __commonJS({
|
|
58930
58344
|
}
|
58931
58345
|
});
|
58932
58346
|
|
58933
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js
|
58347
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js
|
58934
58348
|
var require_runtimeExtensions = __commonJS({
|
58935
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js"(exports2) {
|
58349
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js"(exports2) {
|
58936
58350
|
"use strict";
|
58937
58351
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58938
58352
|
exports2.resolveRuntimeExtensions = void 0;
|
@@ -58961,9 +58375,9 @@ var require_runtimeExtensions = __commonJS({
|
|
58961
58375
|
}
|
58962
58376
|
});
|
58963
58377
|
|
58964
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js
|
58378
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js
|
58965
58379
|
var require_STSClient = __commonJS({
|
58966
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js"(exports2) {
|
58380
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js"(exports2) {
|
58967
58381
|
"use strict";
|
58968
58382
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58969
58383
|
exports2.STSClient = exports2.__Client = void 0;
|
@@ -59025,9 +58439,9 @@ var require_STSClient = __commonJS({
|
|
59025
58439
|
}
|
59026
58440
|
});
|
59027
58441
|
|
59028
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/index.js
|
58442
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/index.js
|
59029
58443
|
var require_dist_cjs50 = __commonJS({
|
59030
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/index.js"(exports2, module2) {
|
58444
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0_@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/index.js"(exports2, module2) {
|
59031
58445
|
"use strict";
|
59032
58446
|
var __defProp3 = Object.defineProperty;
|
59033
58447
|
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
@@ -77644,19 +77058,14 @@ var init_libSqlPushUtils = __esm({
|
|
77644
77058
|
const compositePKs = Object.values(
|
77645
77059
|
json.tables[tableName].compositePrimaryKeys
|
77646
77060
|
).map((it) => SQLiteSquasher.unsquashPK(it));
|
77647
|
-
const checkConstraints = Object.values(json.tables[tableName].checkConstraints);
|
77648
77061
|
const fks = referenceData.map((it) => SQLiteSquasher.unsquashPushFK(it));
|
77649
|
-
const mappedCheckConstraints = checkConstraints.map(
|
77650
|
-
(it) => it.replaceAll(`"${tableName}".`, `"${newTableName}".`).replaceAll(`\`${tableName}\`.`, `\`${newTableName}\`.`).replaceAll(`${tableName}.`, `${newTableName}.`).replaceAll(`'${tableName}'.`, `\`${newTableName}\`.`)
|
77651
|
-
);
|
77652
77062
|
statements.push(
|
77653
77063
|
new SQLiteCreateTableConvertor().convert({
|
77654
77064
|
type: "sqlite_create_table",
|
77655
77065
|
tableName: newTableName,
|
77656
77066
|
columns: tableColumns,
|
77657
77067
|
referenceData: fks,
|
77658
|
-
compositePKs
|
77659
|
-
checkConstraints: mappedCheckConstraints
|
77068
|
+
compositePKs
|
77660
77069
|
})
|
77661
77070
|
);
|
77662
77071
|
if (!dataLoss) {
|
@@ -79547,7 +78956,7 @@ var init_pgIntrospect = __esm({
|
|
79547
78956
|
});
|
79548
78957
|
|
79549
78958
|
// src/introspect-sqlite.ts
|
79550
|
-
var sqliteImportsList, indexName3, objToStatement2, relations, escapeColumnKey, withCasing, schemaToTypeScript, isCyclic, isSelf, mapColumnDefault, column4, createTableColumns, createTableIndexes, createTableUniques,
|
78959
|
+
var sqliteImportsList, indexName3, objToStatement2, relations, escapeColumnKey, withCasing, schemaToTypeScript, isCyclic, isSelf, mapColumnDefault, column4, createTableColumns, createTableIndexes, createTableUniques, createTablePKs, createTableFKs;
|
79551
78960
|
var init_introspect_sqlite = __esm({
|
79552
78961
|
"src/introspect-sqlite.ts"() {
|
79553
78962
|
"use strict";
|
@@ -79606,14 +79015,10 @@ var init_introspect_sqlite = __esm({
|
|
79606
79015
|
const uniqueImports = Object.values(it.uniqueConstraints).map(
|
79607
79016
|
(it2) => "unique"
|
79608
79017
|
);
|
79609
|
-
const checkImports = Object.values(it.checkConstraints).map(
|
79610
|
-
(it2) => "check"
|
79611
|
-
);
|
79612
79018
|
res.sqlite.push(...idxImports);
|
79613
79019
|
res.sqlite.push(...fkImpots);
|
79614
79020
|
res.sqlite.push(...pkImports);
|
79615
79021
|
res.sqlite.push(...uniqueImports);
|
79616
|
-
res.sqlite.push(...checkImports);
|
79617
79022
|
const columnImports = Object.values(it.columns).map((col) => {
|
79618
79023
|
return col.type;
|
79619
79024
|
}).filter((type) => {
|
@@ -79646,7 +79051,7 @@ var init_introspect_sqlite = __esm({
|
|
79646
79051
|
const filteredFKs = Object.values(table4.foreignKeys).filter((it) => {
|
79647
79052
|
return it.columnsFrom.length > 1 || isSelf(it);
|
79648
79053
|
});
|
79649
|
-
if (Object.keys(table4.indexes).length > 0 || filteredFKs.length > 0 || Object.keys(table4.compositePrimaryKeys).length > 0 || Object.keys(table4.uniqueConstraints).length > 0
|
79054
|
+
if (Object.keys(table4.indexes).length > 0 || filteredFKs.length > 0 || Object.keys(table4.compositePrimaryKeys).length > 0 || Object.keys(table4.uniqueConstraints).length > 0) {
|
79650
79055
|
statement += ",\n";
|
79651
79056
|
statement += "(table) => {\n";
|
79652
79057
|
statement += " return {\n";
|
@@ -79664,10 +79069,6 @@ var init_introspect_sqlite = __esm({
|
|
79664
79069
|
Object.values(table4.uniqueConstraints),
|
79665
79070
|
casing2
|
79666
79071
|
);
|
79667
|
-
statement += createTableChecks(
|
79668
|
-
Object.values(table4.checkConstraints),
|
79669
|
-
casing2
|
79670
|
-
);
|
79671
79072
|
statement += " }\n";
|
79672
79073
|
statement += "}";
|
79673
79074
|
}
|
@@ -79818,19 +79219,6 @@ var init_introspect_sqlite = __esm({
|
|
79818
79219
|
statement += `"${it.name}")`;
|
79819
79220
|
statement += `.on(${it.columns.map((it2) => `table.${withCasing(it2, casing2)}`).join(", ")}),`;
|
79820
79221
|
statement += `
|
79821
|
-
`;
|
79822
|
-
});
|
79823
|
-
return statement;
|
79824
|
-
};
|
79825
|
-
createTableChecks = (checks, casing2) => {
|
79826
|
-
let statement = "";
|
79827
|
-
checks.forEach((it) => {
|
79828
|
-
const checkKey = withCasing(it.name, casing2);
|
79829
|
-
statement += ` ${checkKey}: `;
|
79830
|
-
statement += "check(";
|
79831
|
-
statement += `"${it.name}", `;
|
79832
|
-
statement += `sql\`${it.value}\`)`;
|
79833
|
-
statement += `,
|
79834
79222
|
`;
|
79835
79223
|
});
|
79836
79224
|
return statement;
|
@@ -80679,7 +80067,7 @@ var require_pluralize = __commonJS({
|
|
80679
80067
|
});
|
80680
80068
|
|
80681
80069
|
// src/introspect-mysql.ts
|
80682
|
-
var mysqlImportsList, objToStatement22, timeConfig, binaryConfig, importsPatch, relations2, escapeColumnKey2, prepareCasing, schemaToTypeScript2, isCyclic2, isSelf2, mapColumnDefault2, mapColumnDefaultForJson, column5, createTableColumns2, createTableIndexes2, createTableUniques2,
|
80070
|
+
var mysqlImportsList, objToStatement22, timeConfig, binaryConfig, importsPatch, relations2, escapeColumnKey2, prepareCasing, schemaToTypeScript2, isCyclic2, isSelf2, mapColumnDefault2, mapColumnDefaultForJson, column5, createTableColumns2, createTableIndexes2, createTableUniques2, createTablePKs2, createTableFKs2;
|
80683
80071
|
var init_introspect_mysql = __esm({
|
80684
80072
|
"src/introspect-mysql.ts"() {
|
80685
80073
|
"use strict";
|
@@ -80783,14 +80171,10 @@ var init_introspect_mysql = __esm({
|
|
80783
80171
|
const uniqueImports = Object.values(it.uniqueConstraints).map(
|
80784
80172
|
(it2) => "unique"
|
80785
80173
|
);
|
80786
|
-
const checkImports = Object.values(it.checkConstraint).map(
|
80787
|
-
(it2) => "check"
|
80788
|
-
);
|
80789
80174
|
res.mysql.push(...idxImports);
|
80790
80175
|
res.mysql.push(...fkImpots);
|
80791
80176
|
res.mysql.push(...pkImports);
|
80792
80177
|
res.mysql.push(...uniqueImports);
|
80793
|
-
res.mysql.push(...checkImports);
|
80794
80178
|
const columnImports = Object.values(it.columns).map((col) => {
|
80795
80179
|
let patched = importsPatch[col.type] ?? col.type;
|
80796
80180
|
patched = patched.startsWith("varchar(") ? "varchar" : patched;
|
@@ -80835,7 +80219,7 @@ var init_introspect_mysql = __esm({
|
|
80835
80219
|
const filteredFKs = Object.values(table4.foreignKeys).filter((it) => {
|
80836
80220
|
return it.columnsFrom.length > 1 || isSelf2(it);
|
80837
80221
|
});
|
80838
|
-
if (Object.keys(table4.indexes).length > 0 || filteredFKs.length > 0 || Object.keys(table4.compositePrimaryKeys).length > 0 || Object.keys(table4.uniqueConstraints).length > 0
|
80222
|
+
if (Object.keys(table4.indexes).length > 0 || filteredFKs.length > 0 || Object.keys(table4.compositePrimaryKeys).length > 0 || Object.keys(table4.uniqueConstraints).length > 0) {
|
80839
80223
|
statement += ",\n";
|
80840
80224
|
statement += "(table) => {\n";
|
80841
80225
|
statement += " return {\n";
|
@@ -80853,10 +80237,6 @@ var init_introspect_mysql = __esm({
|
|
80853
80237
|
Object.values(table4.uniqueConstraints),
|
80854
80238
|
withCasing4
|
80855
80239
|
);
|
80856
|
-
statement += createTableChecks2(
|
80857
|
-
Object.values(table4.checkConstraint),
|
80858
|
-
withCasing4
|
80859
|
-
);
|
80860
80240
|
statement += " }\n";
|
80861
80241
|
statement += "}";
|
80862
80242
|
}
|
@@ -81193,19 +80573,6 @@ import { sql } from "drizzle-orm"
|
|
81193
80573
|
statement += `"${it.name}")`;
|
81194
80574
|
statement += `.on(${it.columns.map((it2) => `table.${casing2(it2)}`).join(", ")}),`;
|
81195
80575
|
statement += `
|
81196
|
-
`;
|
81197
|
-
});
|
81198
|
-
return statement;
|
81199
|
-
};
|
81200
|
-
createTableChecks2 = (checks, casing2) => {
|
81201
|
-
let statement = "";
|
81202
|
-
checks.forEach((it) => {
|
81203
|
-
const checkKey = casing2(it.name);
|
81204
|
-
statement += ` ${checkKey}: `;
|
81205
|
-
statement += "check(";
|
81206
|
-
statement += `"${it.name}", `;
|
81207
|
-
statement += `sql\`${it.value.replace(/`/g, "\\`")}\`)`;
|
81208
|
-
statement += `,
|
81209
80576
|
`;
|
81210
80577
|
});
|
81211
80578
|
return statement;
|
@@ -81276,7 +80643,7 @@ function generateIdentityParams(identity) {
|
|
81276
80643
|
}
|
81277
80644
|
return `.generatedByDefaultAsIdentity(${paramsObj})`;
|
81278
80645
|
}
|
81279
|
-
var import_drizzle_orm9, import_relations, pgImportsList, timeConfig2, possibleIntervals, intervalStrToObj, intervalConfig, mapColumnDefault3, importsPatch2, relations3, escapeColumnKey3, withCasing2, paramNameFor, schemaToTypeScript3, isCyclic3, isSelf3, buildArrayDefault, mapDefault, column6, dimensionsInArray, createTableColumns3, createTableIndexes3, createTablePKs3, createTableUniques3,
|
80646
|
+
var import_drizzle_orm9, import_relations, pgImportsList, timeConfig2, possibleIntervals, intervalStrToObj, intervalConfig, mapColumnDefault3, importsPatch2, relations3, escapeColumnKey3, withCasing2, paramNameFor, schemaToTypeScript3, isCyclic3, isSelf3, buildArrayDefault, mapDefault, column6, dimensionsInArray, createTableColumns3, createTableIndexes3, createTablePKs3, createTableUniques3, createTableFKs3;
|
81280
80647
|
var init_introspect_pg = __esm({
|
81281
80648
|
"src/introspect-pg.ts"() {
|
81282
80649
|
"use strict";
|
@@ -81444,9 +80811,6 @@ var init_introspect_pg = __esm({
|
|
81444
80811
|
const uniqueImports = Object.values(it.uniqueConstraints).map(
|
81445
80812
|
(it2) => "unique"
|
81446
80813
|
);
|
81447
|
-
const checkImports = Object.values(it.checkConstraints).map(
|
81448
|
-
(it2) => "check"
|
81449
|
-
);
|
81450
80814
|
if (it.schema && it.schema !== "public" && it.schema !== "") {
|
81451
80815
|
res.pg.push("pgSchema");
|
81452
80816
|
}
|
@@ -81454,7 +80818,6 @@ var init_introspect_pg = __esm({
|
|
81454
80818
|
res.pg.push(...fkImpots);
|
81455
80819
|
res.pg.push(...pkImports);
|
81456
80820
|
res.pg.push(...uniqueImports);
|
81457
|
-
res.pg.push(...checkImports);
|
81458
80821
|
const columnImports = Object.values(it.columns).map((col) => {
|
81459
80822
|
let patched = (importsPatch2[col.type] || col.type).replace("[]", "");
|
81460
80823
|
patched = patched === "double precision" ? "doublePrecision" : patched;
|
@@ -81544,7 +80907,7 @@ var init_introspect_pg = __esm({
|
|
81544
80907
|
schema5.internal
|
81545
80908
|
);
|
81546
80909
|
statement += "}";
|
81547
|
-
if (Object.keys(table4.indexes).length > 0 || Object.values(table4.foreignKeys).length > 0 || Object.keys(table4.compositePrimaryKeys).length > 0 || Object.keys(table4.uniqueConstraints).length > 0
|
80910
|
+
if (Object.keys(table4.indexes).length > 0 || Object.values(table4.foreignKeys).length > 0 || Object.keys(table4.compositePrimaryKeys).length > 0 || Object.keys(table4.uniqueConstraints).length > 0) {
|
81548
80911
|
statement += ",\n";
|
81549
80912
|
statement += "(table) => {\n";
|
81550
80913
|
statement += " return {\n";
|
@@ -81562,10 +80925,6 @@ var init_introspect_pg = __esm({
|
|
81562
80925
|
Object.values(table4.uniqueConstraints),
|
81563
80926
|
casing2
|
81564
80927
|
);
|
81565
|
-
statement += createTableChecks3(
|
81566
|
-
Object.values(table4.checkConstraints),
|
81567
|
-
casing2
|
81568
|
-
);
|
81569
80928
|
statement += " }\n";
|
81570
80929
|
statement += "}";
|
81571
80930
|
}
|
@@ -82028,19 +81387,6 @@ var init_introspect_pg = __esm({
|
|
82028
81387
|
statement += `.on(${it.columns.map((it2) => `table.${withCasing2(it2, casing2)}`).join(", ")})`;
|
82029
81388
|
statement += it.nullsNotDistinct ? `.nullsNotDistinct()` : "";
|
82030
81389
|
statement += `,
|
82031
|
-
`;
|
82032
|
-
});
|
82033
|
-
return statement;
|
82034
|
-
};
|
82035
|
-
createTableChecks3 = (checkConstraints, casing2) => {
|
82036
|
-
let statement = "";
|
82037
|
-
checkConstraints.forEach((it) => {
|
82038
|
-
const checkKey = withCasing2(it.name, casing2);
|
82039
|
-
statement += ` ${checkKey}: `;
|
82040
|
-
statement += "check(";
|
82041
|
-
statement += `"${it.name}", `;
|
82042
|
-
statement += `sql\`${it.value}\`)`;
|
82043
|
-
statement += `,
|
82044
81390
|
`;
|
82045
81391
|
});
|
82046
81392
|
return statement;
|
@@ -85876,7 +85222,7 @@ init_utils2();
|
|
85876
85222
|
var version2 = async () => {
|
85877
85223
|
const { npmVersion } = await ormCoreVersions();
|
85878
85224
|
const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
|
85879
|
-
const envVersion = "0.25.0-
|
85225
|
+
const envVersion = "0.25.0-680d055";
|
85880
85226
|
const kitVersion = envVersion ? `v${envVersion}` : "--";
|
85881
85227
|
const versions = `drizzle-kit: ${kitVersion}
|
85882
85228
|
${ormVersion}`;
|