drizzle-kit 0.20.17-0d9aa5f → 0.20.17-2132ef8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.cjs +24264 -14345
- package/cli/commands/migrate.d.ts +2 -2
- package/cli/commands/pgIntrospect.d.ts +1 -1
- package/cli/commands/utils.d.ts +2 -2
- package/cli/validations/cli.d.ts +24 -24
- package/cli/validations/common.d.ts +13 -13
- package/cli/validations/outputs.d.ts +1 -2
- package/index.d.mts +2 -48
- package/index.d.ts +2 -48
- package/package.json +2 -1
- package/payload.js +63 -54
- package/payload.mjs +63 -54
- package/schemaValidator.d.ts +7 -7
- package/serializer/pgSchema.d.ts +14 -14
- package/serializer/studio.d.ts +1 -1
- package/snapshotsDiffer.d.ts +1 -2
- package/utils-studio.js +8 -8
- package/utils-studio.mjs +8 -8
- package/utils.js +5 -5
- package/utils.mjs +5 -5
package/payload.js
CHANGED
|
@@ -4695,7 +4695,7 @@ var init_pgSchema = __esm({
|
|
|
4695
4695
|
}).strict();
|
|
4696
4696
|
pgSchemaInternal = objectType({
|
|
4697
4697
|
version: literalType("6"),
|
|
4698
|
-
dialect: literalType("
|
|
4698
|
+
dialect: literalType("postgresql"),
|
|
4699
4699
|
tables: recordType(stringType(), table2),
|
|
4700
4700
|
enums: recordType(stringType(), enumSchema),
|
|
4701
4701
|
schemas: recordType(stringType(), stringType()),
|
|
@@ -4724,14 +4724,14 @@ var init_pgSchema = __esm({
|
|
|
4724
4724
|
}).strict();
|
|
4725
4725
|
pgSchemaSquashedV4 = objectType({
|
|
4726
4726
|
version: literalType("4"),
|
|
4727
|
-
dialect:
|
|
4727
|
+
dialect: literalType("pg"),
|
|
4728
4728
|
tables: recordType(stringType(), tableSquashedV42),
|
|
4729
4729
|
enums: recordType(stringType(), enumSchemaV1),
|
|
4730
4730
|
schemas: recordType(stringType(), stringType())
|
|
4731
4731
|
}).strict();
|
|
4732
4732
|
pgSchemaSquashed = objectType({
|
|
4733
4733
|
version: literalType("6"),
|
|
4734
|
-
dialect:
|
|
4734
|
+
dialect: literalType("postgresql"),
|
|
4735
4735
|
tables: recordType(stringType(), tableSquashed2),
|
|
4736
4736
|
enums: recordType(stringType(), enumSchema),
|
|
4737
4737
|
schemas: recordType(stringType(), stringType())
|
|
@@ -4842,7 +4842,7 @@ var init_pgSchema = __esm({
|
|
|
4842
4842
|
};
|
|
4843
4843
|
dryPg = pgSchema.parse({
|
|
4844
4844
|
version: snapshotVersion,
|
|
4845
|
-
dialect: "
|
|
4845
|
+
dialect: "postgresql",
|
|
4846
4846
|
id: originUUID,
|
|
4847
4847
|
prevId: "",
|
|
4848
4848
|
tables: {},
|
|
@@ -5305,7 +5305,8 @@ var init_outputs = __esm({
|
|
|
5305
5305
|
warning: (str) => `${source_default.white.bgGray(" Warning ")} ${str}`,
|
|
5306
5306
|
errorWarning: (str) => `${source_default.red(`${source_default.white.bgRed(" Warning ")} ${str}`)}`,
|
|
5307
5307
|
fullWarning: (str) => `${source_default.black.bgYellow("[Warning]")} ${source_default.bold(str)}`,
|
|
5308
|
-
suggestion: (str) => `${source_default.white.bgGray(" Suggestion ")} ${str}
|
|
5308
|
+
suggestion: (str) => `${source_default.white.bgGray(" Suggestion ")} ${str}`,
|
|
5309
|
+
info: (str) => `${source_default.grey(str)}`
|
|
5309
5310
|
};
|
|
5310
5311
|
}
|
|
5311
5312
|
});
|
|
@@ -5390,7 +5391,7 @@ var init_schemaValidator = __esm({
|
|
|
5390
5391
|
init_mysqlSchema();
|
|
5391
5392
|
init_pgSchema();
|
|
5392
5393
|
init_sqliteSchema();
|
|
5393
|
-
dialect3 = enumType(["
|
|
5394
|
+
dialect3 = enumType(["postgresql", "mysql", "sqlite"]);
|
|
5394
5395
|
commonSquashedSchema = unionType([
|
|
5395
5396
|
pgSchemaSquashed,
|
|
5396
5397
|
mysqlSchemaSquashed,
|
|
@@ -5510,8 +5511,8 @@ var init_cli = __esm({
|
|
|
5510
5511
|
dialect: dialect3,
|
|
5511
5512
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
5512
5513
|
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
|
5513
|
-
|
|
5514
|
-
driver: stringType(),
|
|
5514
|
+
schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
|
|
5515
|
+
driver: stringType().optional(),
|
|
5515
5516
|
// pg
|
|
5516
5517
|
connectionString: stringType().optional(),
|
|
5517
5518
|
// mysql
|
|
@@ -5547,7 +5548,7 @@ var init_cli = __esm({
|
|
|
5547
5548
|
ssl: stringType().optional(),
|
|
5548
5549
|
url: stringType().optional(),
|
|
5549
5550
|
authToken: stringType().optional(),
|
|
5550
|
-
|
|
5551
|
+
introspectCasing: casing,
|
|
5551
5552
|
breakpoints: booleanType().optional().default(true)
|
|
5552
5553
|
});
|
|
5553
5554
|
configCheck = objectType({
|
|
@@ -11501,7 +11502,7 @@ ${withStyle.errorWarning(
|
|
|
11501
11502
|
);
|
|
11502
11503
|
return {
|
|
11503
11504
|
version: "6",
|
|
11504
|
-
dialect: "
|
|
11505
|
+
dialect: "postgresql",
|
|
11505
11506
|
tables: result,
|
|
11506
11507
|
enums: enumsToReturn,
|
|
11507
11508
|
schemas: schemasObject,
|
|
@@ -11708,7 +11709,7 @@ ${withStyle.errorWarning(
|
|
|
11708
11709
|
const columnName = columnResponse.attname;
|
|
11709
11710
|
const columnAdditionalDT = columnResponse.additional_dt;
|
|
11710
11711
|
const columnDimensions = columnResponse.array_dimensions;
|
|
11711
|
-
const
|
|
11712
|
+
const enumType3 = columnResponse.enum_name;
|
|
11712
11713
|
let columnType = columnResponse.data_type;
|
|
11713
11714
|
const primaryKey = tableConstraints.filter(
|
|
11714
11715
|
(mapRow) => columnName === mapRow.column_name && mapRow.constraint_type === "PRIMARY KEY"
|
|
@@ -11772,8 +11773,8 @@ ${withStyle.errorWarning(
|
|
|
11772
11773
|
columnTypeMapped = trimChar(columnTypeMapped, '"');
|
|
11773
11774
|
columnToReturn[columnName] = {
|
|
11774
11775
|
name: columnName,
|
|
11775
|
-
type: columnAdditionalDT === "USER-DEFINED" ?
|
|
11776
|
-
typeSchema: enumsToReturn[`${tableSchema}.${
|
|
11776
|
+
type: columnAdditionalDT === "USER-DEFINED" ? enumType3 : columnTypeMapped,
|
|
11777
|
+
typeSchema: enumsToReturn[`${tableSchema}.${enumType3}`] !== void 0 ? enumsToReturn[`${tableSchema}.${enumType3}`].schema : void 0,
|
|
11777
11778
|
primaryKey: primaryKey.length === 1 && cprimaryKey.length < 2,
|
|
11778
11779
|
// default: isSerial ? undefined : defaultValue,
|
|
11779
11780
|
notNull: columnResponse.is_nullable === "NO"
|
|
@@ -11856,7 +11857,7 @@ ${withStyle.errorWarning(
|
|
|
11856
11857
|
const schemasObject = Object.fromEntries([...schemas].map((it) => [it, it]));
|
|
11857
11858
|
return {
|
|
11858
11859
|
version: "6",
|
|
11859
|
-
dialect: "
|
|
11860
|
+
dialect: "postgresql",
|
|
11860
11861
|
tables: result,
|
|
11861
11862
|
enums: enumsToReturn,
|
|
11862
11863
|
schemas: schemasObject,
|
|
@@ -15087,7 +15088,7 @@ var init_snapshotsDiffer = __esm({
|
|
|
15087
15088
|
const jsonTableAlternations = alteredTables.map((it) => {
|
|
15088
15089
|
return preparePgAlterColumns(it.name, it.schema, it.altered, json2);
|
|
15089
15090
|
}).flat();
|
|
15090
|
-
const
|
|
15091
|
+
const jsonCreateIndexesFoAlteredTables = alteredTables.map((it) => {
|
|
15091
15092
|
return prepareCreateIndexesJson(
|
|
15092
15093
|
it.name,
|
|
15093
15094
|
it.schema,
|
|
@@ -15116,14 +15117,21 @@ var init_snapshotsDiffer = __esm({
|
|
|
15116
15117
|
},
|
|
15117
15118
|
{}
|
|
15118
15119
|
);
|
|
15119
|
-
|
|
15120
|
+
jsonCreateIndexesFoAlteredTables.push(
|
|
15120
15121
|
...prepareCreateIndexesJson(it.name, it.schema, createdIndexes || {})
|
|
15121
15122
|
);
|
|
15122
15123
|
jsonDropIndexesForAllAlteredTables.push(
|
|
15123
15124
|
...prepareDropIndexesJson(it.name, it.schema, droppedIndexes || {})
|
|
15124
15125
|
);
|
|
15125
15126
|
});
|
|
15126
|
-
const
|
|
15127
|
+
const jsonCreateReferencesForCreatedTables = createdTables.map((it) => {
|
|
15128
|
+
return prepareCreateReferencesJson(
|
|
15129
|
+
it.name,
|
|
15130
|
+
it.schema,
|
|
15131
|
+
it.foreignKeys
|
|
15132
|
+
);
|
|
15133
|
+
}).flat();
|
|
15134
|
+
const jsonReferencesForAlteredTables = alteredTables.map((it) => {
|
|
15127
15135
|
const forAdded = prepareCreateReferencesJson(
|
|
15128
15136
|
it.name,
|
|
15129
15137
|
it.schema,
|
|
@@ -15141,10 +15149,10 @@ var init_snapshotsDiffer = __esm({
|
|
|
15141
15149
|
);
|
|
15142
15150
|
return [...forAdded, ...forAltered, ...alteredFKs];
|
|
15143
15151
|
}).flat();
|
|
15144
|
-
const jsonCreatedReferencesForAlteredTables =
|
|
15152
|
+
const jsonCreatedReferencesForAlteredTables = jsonReferencesForAlteredTables.filter(
|
|
15145
15153
|
(t) => t.type === "create_reference"
|
|
15146
15154
|
);
|
|
15147
|
-
const jsonDroppedReferencesForAlteredTables =
|
|
15155
|
+
const jsonDroppedReferencesForAlteredTables = jsonReferencesForAlteredTables.filter(
|
|
15148
15156
|
(t) => t.type === "delete_reference"
|
|
15149
15157
|
);
|
|
15150
15158
|
const createEnums = createdEnums.map((it) => {
|
|
@@ -15171,7 +15179,7 @@ var init_snapshotsDiffer = __esm({
|
|
|
15171
15179
|
const dropSchemas = prepareDeleteSchemasJson(
|
|
15172
15180
|
deletedSchemas.map((it) => it.name)
|
|
15173
15181
|
);
|
|
15174
|
-
const
|
|
15182
|
+
const createTables = createdTables.map((it) => {
|
|
15175
15183
|
return preparePgCreateTableJson(it, curFull);
|
|
15176
15184
|
});
|
|
15177
15185
|
jsonStatements.push(...createSchemas);
|
|
@@ -15180,7 +15188,7 @@ var init_snapshotsDiffer = __esm({
|
|
|
15180
15188
|
jsonStatements.push(...moveEnums);
|
|
15181
15189
|
jsonStatements.push(...renameEnums);
|
|
15182
15190
|
jsonStatements.push(...jsonAlterEnumsWithAddedValues);
|
|
15183
|
-
jsonStatements.push(...
|
|
15191
|
+
jsonStatements.push(...createTables);
|
|
15184
15192
|
jsonStatements.push(...jsonDropTables);
|
|
15185
15193
|
jsonStatements.push(...jsonSetTableSchemas);
|
|
15186
15194
|
jsonStatements.push(...jsonRenameTables);
|
|
@@ -15191,15 +15199,16 @@ var init_snapshotsDiffer = __esm({
|
|
|
15191
15199
|
jsonStatements.push(...jsonTableAlternations);
|
|
15192
15200
|
jsonStatements.push(...jsonAddedCompositePKs);
|
|
15193
15201
|
jsonStatements.push(...jsonAddColumnsStatemets);
|
|
15202
|
+
jsonStatements.push(...jsonCreateReferencesForCreatedTables);
|
|
15194
15203
|
jsonStatements.push(...jsonCreateIndexesForCreatedTables);
|
|
15195
|
-
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
|
15196
15204
|
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
|
15205
|
+
jsonStatements.push(...jsonCreateIndexesFoAlteredTables);
|
|
15197
15206
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
|
15198
15207
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
|
15199
15208
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
|
15200
15209
|
jsonStatements.push(...dropEnums);
|
|
15201
15210
|
jsonStatements.push(...dropSchemas);
|
|
15202
|
-
const sqlStatements = fromJson(jsonStatements, "
|
|
15211
|
+
const sqlStatements = fromJson(jsonStatements, "postgresql");
|
|
15203
15212
|
const uniqueSqlStatements = [];
|
|
15204
15213
|
sqlStatements.forEach((ss) => {
|
|
15205
15214
|
if (!uniqueSqlStatements.includes(ss)) {
|
|
@@ -15337,8 +15346,8 @@ var init_snapshotsDiffer = __esm({
|
|
|
15337
15346
|
const jsonDeletedUniqueConstraints = [];
|
|
15338
15347
|
const jsonAlteredUniqueConstraints = [];
|
|
15339
15348
|
const jsonRenameColumnsStatements = columnRenames.map((it) => prepareRenameColumns(it.table, "", it.renames)).flat();
|
|
15349
|
+
const jsonAddColumnsStatemets = columnCreates.map((it) => _prepareAddColumns(it.table, "", it.columns)).flat();
|
|
15340
15350
|
const jsonDropColumnsStatemets = columnDeletes.map((it) => _prepareDropColumns(it.table, "", it.columns)).flat();
|
|
15341
|
-
const jsonAddColumnsStatemets = columnDeletes.map((it) => _prepareAddColumns(it.table, "", it.columns)).flat();
|
|
15342
15351
|
alteredTables.forEach((it) => {
|
|
15343
15352
|
let addedColumns = [];
|
|
15344
15353
|
for (const addedPkName of Object.keys(it.addedCompositePKs)) {
|
|
@@ -16079,7 +16088,7 @@ var init_sqlgenerator = __esm({
|
|
|
16079
16088
|
};
|
|
16080
16089
|
PgCreateTableConvertor = class extends Convertor {
|
|
16081
16090
|
can(statement, dialect7) {
|
|
16082
|
-
return statement.type === "create_table" && dialect7 === "
|
|
16091
|
+
return statement.type === "create_table" && dialect7 === "postgresql";
|
|
16083
16092
|
}
|
|
16084
16093
|
convert(st) {
|
|
16085
16094
|
const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints } = st;
|
|
@@ -16221,7 +16230,7 @@ var init_sqlgenerator = __esm({
|
|
|
16221
16230
|
};
|
|
16222
16231
|
PgAlterTableAddUniqueConstraintConvertor = class extends Convertor {
|
|
16223
16232
|
can(statement, dialect7) {
|
|
16224
|
-
return statement.type === "create_unique_constraint" && dialect7 === "
|
|
16233
|
+
return statement.type === "create_unique_constraint" && dialect7 === "postgresql";
|
|
16225
16234
|
}
|
|
16226
16235
|
convert(statement) {
|
|
16227
16236
|
const unsquashed = PgSquasher.unsquashUnique(statement.data);
|
|
@@ -16231,7 +16240,7 @@ var init_sqlgenerator = __esm({
|
|
|
16231
16240
|
};
|
|
16232
16241
|
PgAlterTableDropUniqueConstraintConvertor = class extends Convertor {
|
|
16233
16242
|
can(statement, dialect7) {
|
|
16234
|
-
return statement.type === "delete_unique_constraint" && dialect7 === "
|
|
16243
|
+
return statement.type === "delete_unique_constraint" && dialect7 === "postgresql";
|
|
16235
16244
|
}
|
|
16236
16245
|
convert(statement) {
|
|
16237
16246
|
const unsquashed = PgSquasher.unsquashUnique(statement.data);
|
|
@@ -16320,7 +16329,7 @@ var init_sqlgenerator = __esm({
|
|
|
16320
16329
|
};
|
|
16321
16330
|
PgDropTableConvertor = class extends Convertor {
|
|
16322
16331
|
can(statement, dialect7) {
|
|
16323
|
-
return statement.type === "drop_table" && dialect7 === "
|
|
16332
|
+
return statement.type === "drop_table" && dialect7 === "postgresql";
|
|
16324
16333
|
}
|
|
16325
16334
|
convert(statement) {
|
|
16326
16335
|
const { tableName, schema: schema4 } = statement;
|
|
@@ -16348,7 +16357,7 @@ var init_sqlgenerator = __esm({
|
|
|
16348
16357
|
};
|
|
16349
16358
|
PgRenameTableConvertor = class extends Convertor {
|
|
16350
16359
|
can(statement, dialect7) {
|
|
16351
|
-
return statement.type === "rename_table" && dialect7 === "
|
|
16360
|
+
return statement.type === "rename_table" && dialect7 === "postgresql";
|
|
16352
16361
|
}
|
|
16353
16362
|
convert(statement) {
|
|
16354
16363
|
const { tableNameFrom, tableNameTo, toSchema, fromSchema } = statement;
|
|
@@ -16379,7 +16388,7 @@ var init_sqlgenerator = __esm({
|
|
|
16379
16388
|
};
|
|
16380
16389
|
PgAlterTableRenameColumnConvertor = class extends Convertor {
|
|
16381
16390
|
can(statement, dialect7) {
|
|
16382
|
-
return statement.type === "alter_table_rename_column" && dialect7 === "
|
|
16391
|
+
return statement.type === "alter_table_rename_column" && dialect7 === "postgresql";
|
|
16383
16392
|
}
|
|
16384
16393
|
convert(statement) {
|
|
16385
16394
|
const { tableName, oldColumnName, newColumnName, schema: schema4 } = statement;
|
|
@@ -16407,7 +16416,7 @@ var init_sqlgenerator = __esm({
|
|
|
16407
16416
|
};
|
|
16408
16417
|
PgAlterTableDropColumnConvertor = class extends Convertor {
|
|
16409
16418
|
can(statement, dialect7) {
|
|
16410
|
-
return statement.type === "alter_table_drop_column" && dialect7 === "
|
|
16419
|
+
return statement.type === "alter_table_drop_column" && dialect7 === "postgresql";
|
|
16411
16420
|
}
|
|
16412
16421
|
convert(statement) {
|
|
16413
16422
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16435,7 +16444,7 @@ var init_sqlgenerator = __esm({
|
|
|
16435
16444
|
};
|
|
16436
16445
|
PgAlterTableAddColumnConvertor = class extends Convertor {
|
|
16437
16446
|
can(statement, dialect7) {
|
|
16438
|
-
return statement.type === "alter_table_add_column" && dialect7 === "
|
|
16447
|
+
return statement.type === "alter_table_add_column" && dialect7 === "postgresql";
|
|
16439
16448
|
}
|
|
16440
16449
|
convert(statement) {
|
|
16441
16450
|
const { tableName, column: column4, schema: schema4 } = statement;
|
|
@@ -16480,7 +16489,7 @@ var init_sqlgenerator = __esm({
|
|
|
16480
16489
|
};
|
|
16481
16490
|
PgAlterTableAlterColumnSetTypeConvertor = class extends Convertor {
|
|
16482
16491
|
can(statement, dialect7) {
|
|
16483
|
-
return statement.type === "alter_table_alter_column_set_type" && dialect7 === "
|
|
16492
|
+
return statement.type === "alter_table_alter_column_set_type" && dialect7 === "postgresql";
|
|
16484
16493
|
}
|
|
16485
16494
|
convert(statement) {
|
|
16486
16495
|
const { tableName, columnName, newDataType, schema: schema4 } = statement;
|
|
@@ -16505,7 +16514,7 @@ var init_sqlgenerator = __esm({
|
|
|
16505
16514
|
};
|
|
16506
16515
|
PgAlterTableAlterColumnSetDefaultConvertor = class extends Convertor {
|
|
16507
16516
|
can(statement, dialect7) {
|
|
16508
|
-
return statement.type === "alter_table_alter_column_set_default" && dialect7 === "
|
|
16517
|
+
return statement.type === "alter_table_alter_column_set_default" && dialect7 === "postgresql";
|
|
16509
16518
|
}
|
|
16510
16519
|
convert(statement) {
|
|
16511
16520
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16530,7 +16539,7 @@ var init_sqlgenerator = __esm({
|
|
|
16530
16539
|
};
|
|
16531
16540
|
PgAlterTableAlterColumnDropDefaultConvertor = class extends Convertor {
|
|
16532
16541
|
can(statement, dialect7) {
|
|
16533
|
-
return statement.type === "alter_table_alter_column_drop_default" && dialect7 === "
|
|
16542
|
+
return statement.type === "alter_table_alter_column_drop_default" && dialect7 === "postgresql";
|
|
16534
16543
|
}
|
|
16535
16544
|
convert(statement) {
|
|
16536
16545
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16642,7 +16651,7 @@ var init_sqlgenerator = __esm({
|
|
|
16642
16651
|
};
|
|
16643
16652
|
PgAlterTableCreateCompositePrimaryKeyConvertor = class extends Convertor {
|
|
16644
16653
|
can(statement, dialect7) {
|
|
16645
|
-
return statement.type === "create_composite_pk" && dialect7 === "
|
|
16654
|
+
return statement.type === "create_composite_pk" && dialect7 === "postgresql";
|
|
16646
16655
|
}
|
|
16647
16656
|
convert(statement) {
|
|
16648
16657
|
const { name, columns } = PgSquasher.unsquashPK(statement.data);
|
|
@@ -16652,7 +16661,7 @@ var init_sqlgenerator = __esm({
|
|
|
16652
16661
|
};
|
|
16653
16662
|
PgAlterTableDeleteCompositePrimaryKeyConvertor = class extends Convertor {
|
|
16654
16663
|
can(statement, dialect7) {
|
|
16655
|
-
return statement.type === "delete_composite_pk" && dialect7 === "
|
|
16664
|
+
return statement.type === "delete_composite_pk" && dialect7 === "postgresql";
|
|
16656
16665
|
}
|
|
16657
16666
|
convert(statement) {
|
|
16658
16667
|
const { name, columns } = PgSquasher.unsquashPK(statement.data);
|
|
@@ -16662,7 +16671,7 @@ var init_sqlgenerator = __esm({
|
|
|
16662
16671
|
};
|
|
16663
16672
|
PgAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor {
|
|
16664
16673
|
can(statement, dialect7) {
|
|
16665
|
-
return statement.type === "alter_composite_pk" && dialect7 === "
|
|
16674
|
+
return statement.type === "alter_composite_pk" && dialect7 === "postgresql";
|
|
16666
16675
|
}
|
|
16667
16676
|
convert(statement) {
|
|
16668
16677
|
const { name, columns } = PgSquasher.unsquashPK(statement.old);
|
|
@@ -16785,7 +16794,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16785
16794
|
};
|
|
16786
16795
|
PgAlterTableAlterColumnSetPrimaryKeyConvertor = class extends Convertor {
|
|
16787
16796
|
can(statement, dialect7) {
|
|
16788
|
-
return statement.type === "alter_table_alter_column_set_pk" && dialect7 === "
|
|
16797
|
+
return statement.type === "alter_table_alter_column_set_pk" && dialect7 === "postgresql";
|
|
16789
16798
|
}
|
|
16790
16799
|
convert(statement) {
|
|
16791
16800
|
const { tableName, columnName } = statement;
|
|
@@ -16795,7 +16804,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16795
16804
|
};
|
|
16796
16805
|
PgAlterTableAlterColumnDropPrimaryKeyConvertor = class extends Convertor {
|
|
16797
16806
|
can(statement, dialect7) {
|
|
16798
|
-
return statement.type === "alter_table_alter_column_drop_pk" && dialect7 === "
|
|
16807
|
+
return statement.type === "alter_table_alter_column_drop_pk" && dialect7 === "postgresql";
|
|
16799
16808
|
}
|
|
16800
16809
|
convert(statement) {
|
|
16801
16810
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16819,7 +16828,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16819
16828
|
};
|
|
16820
16829
|
PgAlterTableAlterColumnSetNotNullConvertor = class extends Convertor {
|
|
16821
16830
|
can(statement, dialect7) {
|
|
16822
|
-
return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "
|
|
16831
|
+
return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "postgresql";
|
|
16823
16832
|
}
|
|
16824
16833
|
convert(statement) {
|
|
16825
16834
|
const { tableName, columnName } = statement;
|
|
@@ -16874,7 +16883,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16874
16883
|
};
|
|
16875
16884
|
PgAlterTableAlterColumnDropNotNullConvertor = class extends Convertor {
|
|
16876
16885
|
can(statement, dialect7) {
|
|
16877
|
-
return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "
|
|
16886
|
+
return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "postgresql";
|
|
16878
16887
|
}
|
|
16879
16888
|
convert(statement) {
|
|
16880
16889
|
const { tableName, columnName } = statement;
|
|
@@ -16899,7 +16908,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16899
16908
|
};
|
|
16900
16909
|
PgCreateForeignKeyConvertor = class extends Convertor {
|
|
16901
16910
|
can(statement, dialect7) {
|
|
16902
|
-
return statement.type === "create_reference" && dialect7 === "
|
|
16911
|
+
return statement.type === "create_reference" && dialect7 === "postgresql";
|
|
16903
16912
|
}
|
|
16904
16913
|
convert(statement) {
|
|
16905
16914
|
const {
|
|
@@ -16964,7 +16973,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16964
16973
|
};
|
|
16965
16974
|
PgAlterForeignKeyConvertor = class extends Convertor {
|
|
16966
16975
|
can(statement, dialect7) {
|
|
16967
|
-
return statement.type === "alter_reference" && dialect7 === "
|
|
16976
|
+
return statement.type === "alter_reference" && dialect7 === "postgresql";
|
|
16968
16977
|
}
|
|
16969
16978
|
convert(statement) {
|
|
16970
16979
|
const newFk = PgSquasher.unsquashFK(statement.data);
|
|
@@ -17003,7 +17012,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17003
17012
|
};
|
|
17004
17013
|
PgDeleteForeignKeyConvertor = class extends Convertor {
|
|
17005
17014
|
can(statement, dialect7) {
|
|
17006
|
-
return statement.type === "delete_reference" && dialect7 === "
|
|
17015
|
+
return statement.type === "delete_reference" && dialect7 === "postgresql";
|
|
17007
17016
|
}
|
|
17008
17017
|
convert(statement) {
|
|
17009
17018
|
const tableFrom = statement.tableName;
|
|
@@ -17040,7 +17049,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17040
17049
|
};
|
|
17041
17050
|
CreatePgIndexConvertor = class extends Convertor {
|
|
17042
17051
|
can(statement, dialect7) {
|
|
17043
|
-
return statement.type === "create_index" && dialect7 === "
|
|
17052
|
+
return statement.type === "create_index" && dialect7 === "postgresql";
|
|
17044
17053
|
}
|
|
17045
17054
|
convert(statement) {
|
|
17046
17055
|
const { name, columns, isUnique } = PgSquasher.unsquashIdx(statement.data);
|
|
@@ -17079,7 +17088,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17079
17088
|
};
|
|
17080
17089
|
PgDropIndexConvertor = class extends Convertor {
|
|
17081
17090
|
can(statement, dialect7) {
|
|
17082
|
-
return statement.type === "drop_index" && dialect7 === "
|
|
17091
|
+
return statement.type === "drop_index" && dialect7 === "postgresql";
|
|
17083
17092
|
}
|
|
17084
17093
|
convert(statement) {
|
|
17085
17094
|
const { name } = PgSquasher.unsquashIdx(statement.data);
|
|
@@ -17088,7 +17097,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17088
17097
|
};
|
|
17089
17098
|
PgCreateSchemaConvertor = class extends Convertor {
|
|
17090
17099
|
can(statement, dialect7) {
|
|
17091
|
-
return statement.type === "create_schema" && dialect7 === "
|
|
17100
|
+
return statement.type === "create_schema" && dialect7 === "postgresql";
|
|
17092
17101
|
}
|
|
17093
17102
|
convert(statement) {
|
|
17094
17103
|
const { name } = statement;
|
|
@@ -17098,7 +17107,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17098
17107
|
};
|
|
17099
17108
|
PgRenameSchemaConvertor = class extends Convertor {
|
|
17100
17109
|
can(statement, dialect7) {
|
|
17101
|
-
return statement.type === "rename_schema" && dialect7 === "
|
|
17110
|
+
return statement.type === "rename_schema" && dialect7 === "postgresql";
|
|
17102
17111
|
}
|
|
17103
17112
|
convert(statement) {
|
|
17104
17113
|
const { from, to } = statement;
|
|
@@ -17108,7 +17117,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17108
17117
|
};
|
|
17109
17118
|
PgDropSchemaConvertor = class extends Convertor {
|
|
17110
17119
|
can(statement, dialect7) {
|
|
17111
|
-
return statement.type === "drop_schema" && dialect7 === "
|
|
17120
|
+
return statement.type === "drop_schema" && dialect7 === "postgresql";
|
|
17112
17121
|
}
|
|
17113
17122
|
convert(statement) {
|
|
17114
17123
|
const { name } = statement;
|
|
@@ -17118,7 +17127,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17118
17127
|
};
|
|
17119
17128
|
PgAlterTableSetSchemaConvertor = class extends Convertor {
|
|
17120
17129
|
can(statement, dialect7) {
|
|
17121
|
-
return statement.type === "alter_table_set_schema" && dialect7 === "
|
|
17130
|
+
return statement.type === "alter_table_set_schema" && dialect7 === "postgresql";
|
|
17122
17131
|
}
|
|
17123
17132
|
convert(statement) {
|
|
17124
17133
|
const { tableName, schemaFrom, schemaTo } = statement;
|
|
@@ -17128,7 +17137,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17128
17137
|
};
|
|
17129
17138
|
PgAlterTableSetNewSchemaConvertor = class extends Convertor {
|
|
17130
17139
|
can(statement, dialect7) {
|
|
17131
|
-
return statement.type === "alter_table_set_new_schema" && dialect7 === "
|
|
17140
|
+
return statement.type === "alter_table_set_new_schema" && dialect7 === "postgresql";
|
|
17132
17141
|
}
|
|
17133
17142
|
convert(statement) {
|
|
17134
17143
|
const { tableName, to, from } = statement;
|
|
@@ -17139,7 +17148,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17139
17148
|
};
|
|
17140
17149
|
PgAlterTableRemoveFromSchemaConvertor = class extends Convertor {
|
|
17141
17150
|
can(statement, dialect7) {
|
|
17142
|
-
return statement.type === "alter_table_remove_from_schema" && dialect7 === "
|
|
17151
|
+
return statement.type === "alter_table_remove_from_schema" && dialect7 === "postgresql";
|
|
17143
17152
|
}
|
|
17144
17153
|
convert(statement) {
|
|
17145
17154
|
const { tableName, schema: schema4 } = statement;
|
|
@@ -18919,7 +18928,7 @@ var pgSuggestions = async (db, statements) => {
|
|
|
18919
18928
|
}
|
|
18920
18929
|
}
|
|
18921
18930
|
}
|
|
18922
|
-
const stmnt = fromJson([statement], "
|
|
18931
|
+
const stmnt = fromJson([statement], "postgresql")[0];
|
|
18923
18932
|
if (typeof stmnt !== "undefined") {
|
|
18924
18933
|
if (statement.type === "drop_table") {
|
|
18925
18934
|
statementsToExecute.push(
|