drizzle-kit 1.0.0-beta.6-0918216 → 1.0.0-beta.6-526b63c
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 +4 -2
- package/package.json +1 -1
package/bin.cjs
CHANGED
|
@@ -43728,14 +43728,16 @@ var init_convertor4 = __esm({
|
|
|
43728
43728
|
columnsTo,
|
|
43729
43729
|
onDelete,
|
|
43730
43730
|
onUpdate,
|
|
43731
|
-
schema: schema5
|
|
43731
|
+
schema: schema5,
|
|
43732
|
+
schemaTo
|
|
43732
43733
|
} = st2.fk;
|
|
43733
43734
|
const onDeleteStatement = onDelete !== "NO ACTION" ? ` ON DELETE ${onDelete}` : "";
|
|
43734
43735
|
const onUpdateStatement = onUpdate !== "NO ACTION" ? ` ON UPDATE ${onUpdate}` : "";
|
|
43735
43736
|
const fromColumnsString = columns.map((it2) => `[${it2}]`).join(",");
|
|
43736
43737
|
const toColumnsString = columnsTo.map((it2) => `[${it2}]`).join(",");
|
|
43737
43738
|
const key = schema5 !== "dbo" ? `[${schema5}].[${table6}]` : `[${table6}]`;
|
|
43738
|
-
|
|
43739
|
+
const keyTo = schemaTo !== "dbo" ? `[${schemaTo}].[${tableTo}]` : `[${tableTo}]`;
|
|
43740
|
+
return `ALTER TABLE ${key} ADD CONSTRAINT [${name}] FOREIGN KEY (${fromColumnsString}) REFERENCES ${keyTo}(${toColumnsString})${onDeleteStatement}${onUpdateStatement};`;
|
|
43739
43741
|
});
|
|
43740
43742
|
createPK2 = convertor4("create_pk", (st2) => {
|
|
43741
43743
|
const { name, schema: schema5, table: table6, columns } = st2.pk;
|