drizzle-kit 0.20.17-388fa1b → 0.20.17-56cc78f
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 +23989 -14080
- 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 +21 -21
- 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 +46 -46
- package/payload.mjs +46 -46
- 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
|
});
|
|
@@ -5327,7 +5328,6 @@ var init_mysql = __esm({
|
|
|
5327
5328
|
}),
|
|
5328
5329
|
objectType({
|
|
5329
5330
|
url: stringType()
|
|
5330
|
-
// TODO: change docs
|
|
5331
5331
|
})
|
|
5332
5332
|
]);
|
|
5333
5333
|
}
|
|
@@ -5391,7 +5391,7 @@ var init_schemaValidator = __esm({
|
|
|
5391
5391
|
init_mysqlSchema();
|
|
5392
5392
|
init_pgSchema();
|
|
5393
5393
|
init_sqliteSchema();
|
|
5394
|
-
dialect3 = enumType(["
|
|
5394
|
+
dialect3 = enumType(["postgresql", "mysql", "sqlite"]);
|
|
5395
5395
|
commonSquashedSchema = unionType([
|
|
5396
5396
|
pgSchemaSquashed,
|
|
5397
5397
|
mysqlSchemaSquashed,
|
|
@@ -5512,7 +5512,7 @@ var init_cli = __esm({
|
|
|
5512
5512
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
5513
5513
|
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
|
5514
5514
|
schemaFilters: unionType([stringType(), stringType().array()]).optional().default(["public"]),
|
|
5515
|
-
driver: stringType(),
|
|
5515
|
+
driver: stringType().optional(),
|
|
5516
5516
|
// pg
|
|
5517
5517
|
connectionString: stringType().optional(),
|
|
5518
5518
|
// mysql
|
|
@@ -5548,7 +5548,7 @@ var init_cli = __esm({
|
|
|
5548
5548
|
ssl: stringType().optional(),
|
|
5549
5549
|
url: stringType().optional(),
|
|
5550
5550
|
authToken: stringType().optional(),
|
|
5551
|
-
|
|
5551
|
+
introspectCasing: casing,
|
|
5552
5552
|
breakpoints: booleanType().optional().default(true)
|
|
5553
5553
|
});
|
|
5554
5554
|
configCheck = objectType({
|
|
@@ -11502,7 +11502,7 @@ ${withStyle.errorWarning(
|
|
|
11502
11502
|
);
|
|
11503
11503
|
return {
|
|
11504
11504
|
version: "6",
|
|
11505
|
-
dialect: "
|
|
11505
|
+
dialect: "postgresql",
|
|
11506
11506
|
tables: result,
|
|
11507
11507
|
enums: enumsToReturn,
|
|
11508
11508
|
schemas: schemasObject,
|
|
@@ -11709,7 +11709,7 @@ ${withStyle.errorWarning(
|
|
|
11709
11709
|
const columnName = columnResponse.attname;
|
|
11710
11710
|
const columnAdditionalDT = columnResponse.additional_dt;
|
|
11711
11711
|
const columnDimensions = columnResponse.array_dimensions;
|
|
11712
|
-
const
|
|
11712
|
+
const enumType3 = columnResponse.enum_name;
|
|
11713
11713
|
let columnType = columnResponse.data_type;
|
|
11714
11714
|
const primaryKey = tableConstraints.filter(
|
|
11715
11715
|
(mapRow) => columnName === mapRow.column_name && mapRow.constraint_type === "PRIMARY KEY"
|
|
@@ -11773,8 +11773,8 @@ ${withStyle.errorWarning(
|
|
|
11773
11773
|
columnTypeMapped = trimChar(columnTypeMapped, '"');
|
|
11774
11774
|
columnToReturn[columnName] = {
|
|
11775
11775
|
name: columnName,
|
|
11776
|
-
type: columnAdditionalDT === "USER-DEFINED" ?
|
|
11777
|
-
typeSchema: enumsToReturn[`${tableSchema}.${
|
|
11776
|
+
type: columnAdditionalDT === "USER-DEFINED" ? enumType3 : columnTypeMapped,
|
|
11777
|
+
typeSchema: enumsToReturn[`${tableSchema}.${enumType3}`] !== void 0 ? enumsToReturn[`${tableSchema}.${enumType3}`].schema : void 0,
|
|
11778
11778
|
primaryKey: primaryKey.length === 1 && cprimaryKey.length < 2,
|
|
11779
11779
|
// default: isSerial ? undefined : defaultValue,
|
|
11780
11780
|
notNull: columnResponse.is_nullable === "NO"
|
|
@@ -11857,7 +11857,7 @@ ${withStyle.errorWarning(
|
|
|
11857
11857
|
const schemasObject = Object.fromEntries([...schemas].map((it) => [it, it]));
|
|
11858
11858
|
return {
|
|
11859
11859
|
version: "6",
|
|
11860
|
-
dialect: "
|
|
11860
|
+
dialect: "postgresql",
|
|
11861
11861
|
tables: result,
|
|
11862
11862
|
enums: enumsToReturn,
|
|
11863
11863
|
schemas: schemasObject,
|
|
@@ -15200,7 +15200,7 @@ var init_snapshotsDiffer = __esm({
|
|
|
15200
15200
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
|
15201
15201
|
jsonStatements.push(...dropEnums);
|
|
15202
15202
|
jsonStatements.push(...dropSchemas);
|
|
15203
|
-
const sqlStatements = fromJson(jsonStatements, "
|
|
15203
|
+
const sqlStatements = fromJson(jsonStatements, "postgresql");
|
|
15204
15204
|
const uniqueSqlStatements = [];
|
|
15205
15205
|
sqlStatements.forEach((ss) => {
|
|
15206
15206
|
if (!uniqueSqlStatements.includes(ss)) {
|
|
@@ -15338,8 +15338,8 @@ var init_snapshotsDiffer = __esm({
|
|
|
15338
15338
|
const jsonDeletedUniqueConstraints = [];
|
|
15339
15339
|
const jsonAlteredUniqueConstraints = [];
|
|
15340
15340
|
const jsonRenameColumnsStatements = columnRenames.map((it) => prepareRenameColumns(it.table, "", it.renames)).flat();
|
|
15341
|
+
const jsonAddColumnsStatemets = columnCreates.map((it) => _prepareAddColumns(it.table, "", it.columns)).flat();
|
|
15341
15342
|
const jsonDropColumnsStatemets = columnDeletes.map((it) => _prepareDropColumns(it.table, "", it.columns)).flat();
|
|
15342
|
-
const jsonAddColumnsStatemets = columnDeletes.map((it) => _prepareAddColumns(it.table, "", it.columns)).flat();
|
|
15343
15343
|
alteredTables.forEach((it) => {
|
|
15344
15344
|
let addedColumns = [];
|
|
15345
15345
|
for (const addedPkName of Object.keys(it.addedCompositePKs)) {
|
|
@@ -16080,7 +16080,7 @@ var init_sqlgenerator = __esm({
|
|
|
16080
16080
|
};
|
|
16081
16081
|
PgCreateTableConvertor = class extends Convertor {
|
|
16082
16082
|
can(statement, dialect7) {
|
|
16083
|
-
return statement.type === "create_table" && dialect7 === "
|
|
16083
|
+
return statement.type === "create_table" && dialect7 === "postgresql";
|
|
16084
16084
|
}
|
|
16085
16085
|
convert(st) {
|
|
16086
16086
|
const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints } = st;
|
|
@@ -16222,7 +16222,7 @@ var init_sqlgenerator = __esm({
|
|
|
16222
16222
|
};
|
|
16223
16223
|
PgAlterTableAddUniqueConstraintConvertor = class extends Convertor {
|
|
16224
16224
|
can(statement, dialect7) {
|
|
16225
|
-
return statement.type === "create_unique_constraint" && dialect7 === "
|
|
16225
|
+
return statement.type === "create_unique_constraint" && dialect7 === "postgresql";
|
|
16226
16226
|
}
|
|
16227
16227
|
convert(statement) {
|
|
16228
16228
|
const unsquashed = PgSquasher.unsquashUnique(statement.data);
|
|
@@ -16232,7 +16232,7 @@ var init_sqlgenerator = __esm({
|
|
|
16232
16232
|
};
|
|
16233
16233
|
PgAlterTableDropUniqueConstraintConvertor = class extends Convertor {
|
|
16234
16234
|
can(statement, dialect7) {
|
|
16235
|
-
return statement.type === "delete_unique_constraint" && dialect7 === "
|
|
16235
|
+
return statement.type === "delete_unique_constraint" && dialect7 === "postgresql";
|
|
16236
16236
|
}
|
|
16237
16237
|
convert(statement) {
|
|
16238
16238
|
const unsquashed = PgSquasher.unsquashUnique(statement.data);
|
|
@@ -16321,7 +16321,7 @@ var init_sqlgenerator = __esm({
|
|
|
16321
16321
|
};
|
|
16322
16322
|
PgDropTableConvertor = class extends Convertor {
|
|
16323
16323
|
can(statement, dialect7) {
|
|
16324
|
-
return statement.type === "drop_table" && dialect7 === "
|
|
16324
|
+
return statement.type === "drop_table" && dialect7 === "postgresql";
|
|
16325
16325
|
}
|
|
16326
16326
|
convert(statement) {
|
|
16327
16327
|
const { tableName, schema: schema4 } = statement;
|
|
@@ -16349,7 +16349,7 @@ var init_sqlgenerator = __esm({
|
|
|
16349
16349
|
};
|
|
16350
16350
|
PgRenameTableConvertor = class extends Convertor {
|
|
16351
16351
|
can(statement, dialect7) {
|
|
16352
|
-
return statement.type === "rename_table" && dialect7 === "
|
|
16352
|
+
return statement.type === "rename_table" && dialect7 === "postgresql";
|
|
16353
16353
|
}
|
|
16354
16354
|
convert(statement) {
|
|
16355
16355
|
const { tableNameFrom, tableNameTo, toSchema, fromSchema } = statement;
|
|
@@ -16380,7 +16380,7 @@ var init_sqlgenerator = __esm({
|
|
|
16380
16380
|
};
|
|
16381
16381
|
PgAlterTableRenameColumnConvertor = class extends Convertor {
|
|
16382
16382
|
can(statement, dialect7) {
|
|
16383
|
-
return statement.type === "alter_table_rename_column" && dialect7 === "
|
|
16383
|
+
return statement.type === "alter_table_rename_column" && dialect7 === "postgresql";
|
|
16384
16384
|
}
|
|
16385
16385
|
convert(statement) {
|
|
16386
16386
|
const { tableName, oldColumnName, newColumnName, schema: schema4 } = statement;
|
|
@@ -16408,7 +16408,7 @@ var init_sqlgenerator = __esm({
|
|
|
16408
16408
|
};
|
|
16409
16409
|
PgAlterTableDropColumnConvertor = class extends Convertor {
|
|
16410
16410
|
can(statement, dialect7) {
|
|
16411
|
-
return statement.type === "alter_table_drop_column" && dialect7 === "
|
|
16411
|
+
return statement.type === "alter_table_drop_column" && dialect7 === "postgresql";
|
|
16412
16412
|
}
|
|
16413
16413
|
convert(statement) {
|
|
16414
16414
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16436,7 +16436,7 @@ var init_sqlgenerator = __esm({
|
|
|
16436
16436
|
};
|
|
16437
16437
|
PgAlterTableAddColumnConvertor = class extends Convertor {
|
|
16438
16438
|
can(statement, dialect7) {
|
|
16439
|
-
return statement.type === "alter_table_add_column" && dialect7 === "
|
|
16439
|
+
return statement.type === "alter_table_add_column" && dialect7 === "postgresql";
|
|
16440
16440
|
}
|
|
16441
16441
|
convert(statement) {
|
|
16442
16442
|
const { tableName, column: column4, schema: schema4 } = statement;
|
|
@@ -16481,7 +16481,7 @@ var init_sqlgenerator = __esm({
|
|
|
16481
16481
|
};
|
|
16482
16482
|
PgAlterTableAlterColumnSetTypeConvertor = class extends Convertor {
|
|
16483
16483
|
can(statement, dialect7) {
|
|
16484
|
-
return statement.type === "alter_table_alter_column_set_type" && dialect7 === "
|
|
16484
|
+
return statement.type === "alter_table_alter_column_set_type" && dialect7 === "postgresql";
|
|
16485
16485
|
}
|
|
16486
16486
|
convert(statement) {
|
|
16487
16487
|
const { tableName, columnName, newDataType, schema: schema4 } = statement;
|
|
@@ -16506,7 +16506,7 @@ var init_sqlgenerator = __esm({
|
|
|
16506
16506
|
};
|
|
16507
16507
|
PgAlterTableAlterColumnSetDefaultConvertor = class extends Convertor {
|
|
16508
16508
|
can(statement, dialect7) {
|
|
16509
|
-
return statement.type === "alter_table_alter_column_set_default" && dialect7 === "
|
|
16509
|
+
return statement.type === "alter_table_alter_column_set_default" && dialect7 === "postgresql";
|
|
16510
16510
|
}
|
|
16511
16511
|
convert(statement) {
|
|
16512
16512
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16531,7 +16531,7 @@ var init_sqlgenerator = __esm({
|
|
|
16531
16531
|
};
|
|
16532
16532
|
PgAlterTableAlterColumnDropDefaultConvertor = class extends Convertor {
|
|
16533
16533
|
can(statement, dialect7) {
|
|
16534
|
-
return statement.type === "alter_table_alter_column_drop_default" && dialect7 === "
|
|
16534
|
+
return statement.type === "alter_table_alter_column_drop_default" && dialect7 === "postgresql";
|
|
16535
16535
|
}
|
|
16536
16536
|
convert(statement) {
|
|
16537
16537
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16643,7 +16643,7 @@ var init_sqlgenerator = __esm({
|
|
|
16643
16643
|
};
|
|
16644
16644
|
PgAlterTableCreateCompositePrimaryKeyConvertor = class extends Convertor {
|
|
16645
16645
|
can(statement, dialect7) {
|
|
16646
|
-
return statement.type === "create_composite_pk" && dialect7 === "
|
|
16646
|
+
return statement.type === "create_composite_pk" && dialect7 === "postgresql";
|
|
16647
16647
|
}
|
|
16648
16648
|
convert(statement) {
|
|
16649
16649
|
const { name, columns } = PgSquasher.unsquashPK(statement.data);
|
|
@@ -16653,7 +16653,7 @@ var init_sqlgenerator = __esm({
|
|
|
16653
16653
|
};
|
|
16654
16654
|
PgAlterTableDeleteCompositePrimaryKeyConvertor = class extends Convertor {
|
|
16655
16655
|
can(statement, dialect7) {
|
|
16656
|
-
return statement.type === "delete_composite_pk" && dialect7 === "
|
|
16656
|
+
return statement.type === "delete_composite_pk" && dialect7 === "postgresql";
|
|
16657
16657
|
}
|
|
16658
16658
|
convert(statement) {
|
|
16659
16659
|
const { name, columns } = PgSquasher.unsquashPK(statement.data);
|
|
@@ -16663,7 +16663,7 @@ var init_sqlgenerator = __esm({
|
|
|
16663
16663
|
};
|
|
16664
16664
|
PgAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor {
|
|
16665
16665
|
can(statement, dialect7) {
|
|
16666
|
-
return statement.type === "alter_composite_pk" && dialect7 === "
|
|
16666
|
+
return statement.type === "alter_composite_pk" && dialect7 === "postgresql";
|
|
16667
16667
|
}
|
|
16668
16668
|
convert(statement) {
|
|
16669
16669
|
const { name, columns } = PgSquasher.unsquashPK(statement.old);
|
|
@@ -16786,7 +16786,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16786
16786
|
};
|
|
16787
16787
|
PgAlterTableAlterColumnSetPrimaryKeyConvertor = class extends Convertor {
|
|
16788
16788
|
can(statement, dialect7) {
|
|
16789
|
-
return statement.type === "alter_table_alter_column_set_pk" && dialect7 === "
|
|
16789
|
+
return statement.type === "alter_table_alter_column_set_pk" && dialect7 === "postgresql";
|
|
16790
16790
|
}
|
|
16791
16791
|
convert(statement) {
|
|
16792
16792
|
const { tableName, columnName } = statement;
|
|
@@ -16796,7 +16796,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16796
16796
|
};
|
|
16797
16797
|
PgAlterTableAlterColumnDropPrimaryKeyConvertor = class extends Convertor {
|
|
16798
16798
|
can(statement, dialect7) {
|
|
16799
|
-
return statement.type === "alter_table_alter_column_drop_pk" && dialect7 === "
|
|
16799
|
+
return statement.type === "alter_table_alter_column_drop_pk" && dialect7 === "postgresql";
|
|
16800
16800
|
}
|
|
16801
16801
|
convert(statement) {
|
|
16802
16802
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16820,7 +16820,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16820
16820
|
};
|
|
16821
16821
|
PgAlterTableAlterColumnSetNotNullConvertor = class extends Convertor {
|
|
16822
16822
|
can(statement, dialect7) {
|
|
16823
|
-
return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "
|
|
16823
|
+
return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "postgresql";
|
|
16824
16824
|
}
|
|
16825
16825
|
convert(statement) {
|
|
16826
16826
|
const { tableName, columnName } = statement;
|
|
@@ -16875,7 +16875,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16875
16875
|
};
|
|
16876
16876
|
PgAlterTableAlterColumnDropNotNullConvertor = class extends Convertor {
|
|
16877
16877
|
can(statement, dialect7) {
|
|
16878
|
-
return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "
|
|
16878
|
+
return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "postgresql";
|
|
16879
16879
|
}
|
|
16880
16880
|
convert(statement) {
|
|
16881
16881
|
const { tableName, columnName } = statement;
|
|
@@ -16900,7 +16900,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16900
16900
|
};
|
|
16901
16901
|
PgCreateForeignKeyConvertor = class extends Convertor {
|
|
16902
16902
|
can(statement, dialect7) {
|
|
16903
|
-
return statement.type === "create_reference" && dialect7 === "
|
|
16903
|
+
return statement.type === "create_reference" && dialect7 === "postgresql";
|
|
16904
16904
|
}
|
|
16905
16905
|
convert(statement) {
|
|
16906
16906
|
const {
|
|
@@ -16965,7 +16965,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16965
16965
|
};
|
|
16966
16966
|
PgAlterForeignKeyConvertor = class extends Convertor {
|
|
16967
16967
|
can(statement, dialect7) {
|
|
16968
|
-
return statement.type === "alter_reference" && dialect7 === "
|
|
16968
|
+
return statement.type === "alter_reference" && dialect7 === "postgresql";
|
|
16969
16969
|
}
|
|
16970
16970
|
convert(statement) {
|
|
16971
16971
|
const newFk = PgSquasher.unsquashFK(statement.data);
|
|
@@ -17004,7 +17004,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17004
17004
|
};
|
|
17005
17005
|
PgDeleteForeignKeyConvertor = class extends Convertor {
|
|
17006
17006
|
can(statement, dialect7) {
|
|
17007
|
-
return statement.type === "delete_reference" && dialect7 === "
|
|
17007
|
+
return statement.type === "delete_reference" && dialect7 === "postgresql";
|
|
17008
17008
|
}
|
|
17009
17009
|
convert(statement) {
|
|
17010
17010
|
const tableFrom = statement.tableName;
|
|
@@ -17041,7 +17041,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17041
17041
|
};
|
|
17042
17042
|
CreatePgIndexConvertor = class extends Convertor {
|
|
17043
17043
|
can(statement, dialect7) {
|
|
17044
|
-
return statement.type === "create_index" && dialect7 === "
|
|
17044
|
+
return statement.type === "create_index" && dialect7 === "postgresql";
|
|
17045
17045
|
}
|
|
17046
17046
|
convert(statement) {
|
|
17047
17047
|
const { name, columns, isUnique } = PgSquasher.unsquashIdx(statement.data);
|
|
@@ -17080,7 +17080,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17080
17080
|
};
|
|
17081
17081
|
PgDropIndexConvertor = class extends Convertor {
|
|
17082
17082
|
can(statement, dialect7) {
|
|
17083
|
-
return statement.type === "drop_index" && dialect7 === "
|
|
17083
|
+
return statement.type === "drop_index" && dialect7 === "postgresql";
|
|
17084
17084
|
}
|
|
17085
17085
|
convert(statement) {
|
|
17086
17086
|
const { name } = PgSquasher.unsquashIdx(statement.data);
|
|
@@ -17089,7 +17089,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17089
17089
|
};
|
|
17090
17090
|
PgCreateSchemaConvertor = class extends Convertor {
|
|
17091
17091
|
can(statement, dialect7) {
|
|
17092
|
-
return statement.type === "create_schema" && dialect7 === "
|
|
17092
|
+
return statement.type === "create_schema" && dialect7 === "postgresql";
|
|
17093
17093
|
}
|
|
17094
17094
|
convert(statement) {
|
|
17095
17095
|
const { name } = statement;
|
|
@@ -17099,7 +17099,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17099
17099
|
};
|
|
17100
17100
|
PgRenameSchemaConvertor = class extends Convertor {
|
|
17101
17101
|
can(statement, dialect7) {
|
|
17102
|
-
return statement.type === "rename_schema" && dialect7 === "
|
|
17102
|
+
return statement.type === "rename_schema" && dialect7 === "postgresql";
|
|
17103
17103
|
}
|
|
17104
17104
|
convert(statement) {
|
|
17105
17105
|
const { from, to } = statement;
|
|
@@ -17109,7 +17109,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17109
17109
|
};
|
|
17110
17110
|
PgDropSchemaConvertor = class extends Convertor {
|
|
17111
17111
|
can(statement, dialect7) {
|
|
17112
|
-
return statement.type === "drop_schema" && dialect7 === "
|
|
17112
|
+
return statement.type === "drop_schema" && dialect7 === "postgresql";
|
|
17113
17113
|
}
|
|
17114
17114
|
convert(statement) {
|
|
17115
17115
|
const { name } = statement;
|
|
@@ -17119,7 +17119,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17119
17119
|
};
|
|
17120
17120
|
PgAlterTableSetSchemaConvertor = class extends Convertor {
|
|
17121
17121
|
can(statement, dialect7) {
|
|
17122
|
-
return statement.type === "alter_table_set_schema" && dialect7 === "
|
|
17122
|
+
return statement.type === "alter_table_set_schema" && dialect7 === "postgresql";
|
|
17123
17123
|
}
|
|
17124
17124
|
convert(statement) {
|
|
17125
17125
|
const { tableName, schemaFrom, schemaTo } = statement;
|
|
@@ -17129,7 +17129,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17129
17129
|
};
|
|
17130
17130
|
PgAlterTableSetNewSchemaConvertor = class extends Convertor {
|
|
17131
17131
|
can(statement, dialect7) {
|
|
17132
|
-
return statement.type === "alter_table_set_new_schema" && dialect7 === "
|
|
17132
|
+
return statement.type === "alter_table_set_new_schema" && dialect7 === "postgresql";
|
|
17133
17133
|
}
|
|
17134
17134
|
convert(statement) {
|
|
17135
17135
|
const { tableName, to, from } = statement;
|
|
@@ -17140,7 +17140,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17140
17140
|
};
|
|
17141
17141
|
PgAlterTableRemoveFromSchemaConvertor = class extends Convertor {
|
|
17142
17142
|
can(statement, dialect7) {
|
|
17143
|
-
return statement.type === "alter_table_remove_from_schema" && dialect7 === "
|
|
17143
|
+
return statement.type === "alter_table_remove_from_schema" && dialect7 === "postgresql";
|
|
17144
17144
|
}
|
|
17145
17145
|
convert(statement) {
|
|
17146
17146
|
const { tableName, schema: schema4 } = statement;
|
|
@@ -18920,7 +18920,7 @@ var pgSuggestions = async (db, statements) => {
|
|
|
18920
18920
|
}
|
|
18921
18921
|
}
|
|
18922
18922
|
}
|
|
18923
|
-
const stmnt = fromJson([statement], "
|
|
18923
|
+
const stmnt = fromJson([statement], "postgresql")[0];
|
|
18924
18924
|
if (typeof stmnt !== "undefined") {
|
|
18925
18925
|
if (statement.type === "drop_table") {
|
|
18926
18926
|
statementsToExecute.push(
|