drizzle-kit 0.29.0-3f3eb73 → 0.29.0-7c72529
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/api.js +318 -224
- package/api.mjs +318 -224
- package/bin.cjs +11 -20
- package/package.json +1 -1
package/bin.cjs
CHANGED
@@ -42787,7 +42787,7 @@ var init_sqlgenerator = __esm({
|
|
42787
42787
|
const { tableName, schema: schema6, columns, compositePKs, uniqueConstraints, checkConstraints, policies, isRLSEnabled } = st;
|
42788
42788
|
let statement = "";
|
42789
42789
|
const name = schema6 ? `"${schema6}"."${tableName}"` : `"${tableName}"`;
|
42790
|
-
statement += `CREATE TABLE
|
42790
|
+
statement += `CREATE TABLE ${name} (
|
42791
42791
|
`;
|
42792
42792
|
for (let i2 = 0; i2 < columns.length; i2++) {
|
42793
42793
|
const column9 = columns[i2];
|
@@ -43633,7 +43633,7 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
43633
43633
|
convert(statement) {
|
43634
43634
|
const { tableName, columnName, schema: schema6 } = statement;
|
43635
43635
|
const tableNameWithSchema = schema6 ? `"${schema6}"."${tableName}"` : `"${tableName}"`;
|
43636
|
-
return `ALTER TABLE ${tableNameWithSchema} DROP COLUMN
|
43636
|
+
return `ALTER TABLE ${tableNameWithSchema} DROP COLUMN "${columnName}";`;
|
43637
43637
|
}
|
43638
43638
|
};
|
43639
43639
|
MySqlAlterTableDropColumnConvertor = class extends Convertor {
|
@@ -44054,7 +44054,7 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
44054
44054
|
for (const table5 of Object.values(json2.tables)) {
|
44055
44055
|
for (const index5 of Object.values(table5.indexes)) {
|
44056
44056
|
const unsquashed = SQLiteSquasher.unsquashIdx(index5);
|
44057
|
-
sqlStatements.push(`DROP INDEX
|
44057
|
+
sqlStatements.push(`DROP INDEX "${unsquashed.name}";`);
|
44058
44058
|
indexes.push({ ...unsquashed, tableName: table5.name });
|
44059
44059
|
}
|
44060
44060
|
}
|
@@ -44570,13 +44570,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
44570
44570
|
const toColumnsString = columnsTo.map((it) => `"${it}"`).join(",");
|
44571
44571
|
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${tableFrom}"` : `"${tableFrom}"`;
|
44572
44572
|
const tableToNameWithSchema = schemaTo ? `"${schemaTo}"."${tableTo}"` : `"${tableTo}"`;
|
44573
|
-
const alterStatement = `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}
|
44574
|
-
|
44575
|
-
sql += " " + alterStatement + ";\n";
|
44576
|
-
sql += "EXCEPTION\n";
|
44577
|
-
sql += " WHEN duplicate_object THEN null;\n";
|
44578
|
-
sql += "END $$;\n";
|
44579
|
-
return sql;
|
44573
|
+
const alterStatement = `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement};`;
|
44574
|
+
return alterStatement;
|
44580
44575
|
}
|
44581
44576
|
};
|
44582
44577
|
LibSQLCreateForeignKeyConvertor = class extends Convertor {
|
@@ -44633,12 +44628,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
44633
44628
|
const toColumnsString = newFk.columnsTo.map((it) => `"${it}"`).join(",");
|
44634
44629
|
const tableFromNameWithSchema = oldFk.schemaTo ? `"${oldFk.schemaTo}"."${oldFk.tableFrom}"` : `"${oldFk.tableFrom}"`;
|
44635
44630
|
const tableToNameWithSchema = newFk.schemaTo ? `"${newFk.schemaTo}"."${newFk.tableFrom}"` : `"${newFk.tableFrom}"`;
|
44636
|
-
const alterStatement = `ALTER TABLE ${tableFromNameWithSchema} ADD CONSTRAINT "${newFk.name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}
|
44637
|
-
sql +=
|
44638
|
-
sql += " " + alterStatement + ";\n";
|
44639
|
-
sql += "EXCEPTION\n";
|
44640
|
-
sql += " WHEN duplicate_object THEN null;\n";
|
44641
|
-
sql += "END $$;\n";
|
44631
|
+
const alterStatement = `ALTER TABLE ${tableFromNameWithSchema} ADD CONSTRAINT "${newFk.name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement};`;
|
44632
|
+
sql += alterStatement;
|
44642
44633
|
return sql;
|
44643
44634
|
}
|
44644
44635
|
};
|
@@ -44694,7 +44685,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
44694
44685
|
reversedString = reversedString.slice(0, -1);
|
44695
44686
|
return reversedString;
|
44696
44687
|
}
|
44697
|
-
return `CREATE ${indexPart}${concurrently ? " CONCURRENTLY" : ""}
|
44688
|
+
return `CREATE ${indexPart}${concurrently ? " CONCURRENTLY" : ""} "${name}" ON ${tableNameWithSchema} USING ${method} (${value})${Object.keys(withMap).length !== 0 ? ` WITH (${reverseLogic(withMap)})` : ""}${where ? ` WHERE ${where}` : ""};`;
|
44698
44689
|
}
|
44699
44690
|
};
|
44700
44691
|
CreateMySqlIndexConvertor = class extends Convertor {
|
@@ -44752,7 +44743,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
44752
44743
|
}
|
44753
44744
|
convert(statement) {
|
44754
44745
|
const { name } = PgSquasher.unsquashIdx(statement.data);
|
44755
|
-
return `DROP INDEX
|
44746
|
+
return `DROP INDEX "${name}";`;
|
44756
44747
|
}
|
44757
44748
|
};
|
44758
44749
|
PgCreateSchemaConvertor = class extends Convertor {
|
@@ -44823,7 +44814,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
44823
44814
|
}
|
44824
44815
|
convert(statement) {
|
44825
44816
|
const { name } = PgSquasher.unsquashIdx(statement.data);
|
44826
|
-
return `DROP INDEX
|
44817
|
+
return `DROP INDEX \`${name}\`;`;
|
44827
44818
|
}
|
44828
44819
|
};
|
44829
44820
|
MySqlDropIndexConvertor = class extends Convertor {
|
@@ -92435,7 +92426,7 @@ init_utils5();
|
|
92435
92426
|
var version2 = async () => {
|
92436
92427
|
const { npmVersion } = await ormCoreVersions();
|
92437
92428
|
const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
|
92438
|
-
const envVersion = "0.29.0-
|
92429
|
+
const envVersion = "0.29.0-7c72529";
|
92439
92430
|
const kitVersion = envVersion ? `v${envVersion}` : "--";
|
92440
92431
|
const versions = `drizzle-kit: ${kitVersion}
|
92441
92432
|
${ormVersion}`;
|