rake-db 2.20.13 → 2.20.15
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/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -495,7 +495,9 @@ const makeAst$2 = (up, tableName, shape, tableData, options, noPrimaryKey) => {
|
|
|
495
495
|
name: table,
|
|
496
496
|
shape
|
|
497
497
|
}, tableData), {
|
|
498
|
-
primaryKey: shapePKeys.length <= 1 ? primaryKey : primaryKey ? __spreadProps$6(__spreadValues$8({}, primaryKey), {
|
|
498
|
+
primaryKey: shapePKeys.length <= 1 ? primaryKey : primaryKey ? __spreadProps$6(__spreadValues$8({}, primaryKey), {
|
|
499
|
+
columns: [.../* @__PURE__ */ new Set([...shapePKeys, ...primaryKey.columns])]
|
|
500
|
+
}) : { columns: shapePKeys }
|
|
499
501
|
}), options), {
|
|
500
502
|
noPrimaryKey: options.noPrimaryKey ? "ignore" : noPrimaryKey || "error"
|
|
501
503
|
});
|
|
@@ -960,6 +962,7 @@ const astToQueries = (ast, snakeCase, language) => {
|
|
|
960
962
|
);
|
|
961
963
|
alterTable.unshift(...prependAlterTable);
|
|
962
964
|
if (ast.add.primaryKey || addPrimaryKeys.change || addPrimaryKeys.columns.length > 1) {
|
|
965
|
+
addPrimaryKeys.columns = [...new Set(addPrimaryKeys.columns)];
|
|
963
966
|
alterTable.push(
|
|
964
967
|
`ADD ${primaryKeyToSql(
|
|
965
968
|
snakeCase ? {
|