rake-db 2.3.31 → 2.3.33
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.d.ts +10 -22
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -274,7 +274,7 @@ const columnToSql = (key, item, values, hasMultiplePrimaryKeys) => {
|
|
|
274
274
|
if (item.data.collate) {
|
|
275
275
|
line.push(`COLLATE ${quote(item.data.collate)}`);
|
|
276
276
|
}
|
|
277
|
-
if (item.isPrimaryKey && !hasMultiplePrimaryKeys) {
|
|
277
|
+
if (item.data.isPrimaryKey && !hasMultiplePrimaryKeys) {
|
|
278
278
|
line.push("PRIMARY KEY");
|
|
279
279
|
} else if (!item.data.isNullable) {
|
|
280
280
|
line.push("NOT NULL");
|
|
@@ -501,7 +501,7 @@ const createTable$1 = async (migration, up, tableName, options, fn) => {
|
|
|
501
501
|
const makeAst$1 = (up, tableName, shape, tableData, options, noPrimaryKey) => {
|
|
502
502
|
const shapePKeys = [];
|
|
503
503
|
for (const key in shape) {
|
|
504
|
-
if (shape[key].isPrimaryKey) {
|
|
504
|
+
if (shape[key].data.isPrimaryKey) {
|
|
505
505
|
shapePKeys.push(key);
|
|
506
506
|
}
|
|
507
507
|
}
|
|
@@ -525,7 +525,7 @@ const validatePrimaryKey = (ast) => {
|
|
|
525
525
|
let hasPrimaryKey = !!((_b = (_a = ast.primaryKey) == null ? void 0 : _a.columns) == null ? void 0 : _b.length);
|
|
526
526
|
if (!hasPrimaryKey) {
|
|
527
527
|
for (const key in ast.shape) {
|
|
528
|
-
if (ast.shape[key].isPrimaryKey) {
|
|
528
|
+
if (ast.shape[key].data.isPrimaryKey) {
|
|
529
529
|
hasPrimaryKey = true;
|
|
530
530
|
break;
|
|
531
531
|
}
|
|
@@ -684,7 +684,7 @@ const columnTypeToColumnChange = (item) => {
|
|
|
684
684
|
column: item,
|
|
685
685
|
type: item.toSQL(),
|
|
686
686
|
nullable: item.data.isNullable,
|
|
687
|
-
primaryKey: item.isPrimaryKey
|
|
687
|
+
primaryKey: item.data.isPrimaryKey
|
|
688
688
|
}, item.data), {
|
|
689
689
|
foreignKeys
|
|
690
690
|
});
|
|
@@ -789,11 +789,11 @@ const astToQueries = (ast) => {
|
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
791
|
if (item.type === "add") {
|
|
792
|
-
if (item.item.isPrimaryKey) {
|
|
792
|
+
if (item.item.data.isPrimaryKey) {
|
|
793
793
|
addPrimaryKeys.columns.push(key);
|
|
794
794
|
}
|
|
795
795
|
} else if (item.type === "drop") {
|
|
796
|
-
if (item.item.isPrimaryKey) {
|
|
796
|
+
if (item.item.data.isPrimaryKey) {
|
|
797
797
|
dropPrimaryKeys.columns.push(key);
|
|
798
798
|
}
|
|
799
799
|
} else if (item.type === "change") {
|