bun-query-builder 0.2.14 → 0.2.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/bin/cli.js +14 -8
- package/dist/src/index.js +13 -7
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -29296,14 +29296,20 @@ function generateDiffOperations(previous, next, opts = {}) {
|
|
|
29296
29296
|
removedCols = detected.removed;
|
|
29297
29297
|
addedCols = detected.added;
|
|
29298
29298
|
}
|
|
29299
|
-
if (preserveUnknownColumns
|
|
29299
|
+
if (preserveUnknownColumns) {
|
|
29300
29300
|
const preserved = removedCols.map((name) => prevCols[name]);
|
|
29301
|
-
const
|
|
29302
|
-
|
|
29303
|
-
|
|
29304
|
-
|
|
29305
|
-
|
|
29306
|
-
|
|
29301
|
+
const keptIndexes = prev.indexes.filter((idx) => !currIdx[indexKey(idx, prev.table)]);
|
|
29302
|
+
if (preserved.length > 0 || keptIndexes.length > 0) {
|
|
29303
|
+
if (preserved.length > 0) {
|
|
29304
|
+
info2(`-- Keeping ${preserved.length} column(s) on "${curr.table}" no model declares: ${removedCols.join(", ")} \u2014 reconciled from the database, where an undeclared column is out of scope rather than removed`);
|
|
29305
|
+
}
|
|
29306
|
+
if (keptIndexes.length > 0) {
|
|
29307
|
+
info2(`-- Keeping ${keptIndexes.length} index(es) on "${curr.table}" no model declares: ${keptIndexes.map((index) => index.name).join(", ")} \u2014 reconciled from the database, where an undeclared index is out of scope rather than removed`);
|
|
29308
|
+
}
|
|
29309
|
+
curr = { ...curr, columns: [...curr.columns, ...preserved], indexes: [...curr.indexes, ...keptIndexes] };
|
|
29310
|
+
currCols = mapColumnsByName(curr.columns);
|
|
29311
|
+
currIdx = mapIndexesByKey(curr.indexes, curr.table);
|
|
29312
|
+
}
|
|
29307
29313
|
removedCols = [];
|
|
29308
29314
|
}
|
|
29309
29315
|
const modifiedCols = Object.keys(currCols).filter((n2) => prevCols[n2] && columnsAreDifferent(prevCols[n2], currCols[n2], dialect));
|
|
@@ -31542,7 +31548,7 @@ function getPrefix() {
|
|
|
31542
31548
|
}
|
|
31543
31549
|
var prefix = getPrefix();
|
|
31544
31550
|
// package.json
|
|
31545
|
-
var version2 = "0.2.
|
|
31551
|
+
var version2 = "0.2.15";
|
|
31546
31552
|
|
|
31547
31553
|
// bin/cli.ts
|
|
31548
31554
|
init_actions();
|
package/dist/src/index.js
CHANGED
|
@@ -29295,14 +29295,20 @@ function generateDiffOperations(previous, next, opts = {}) {
|
|
|
29295
29295
|
removedCols = detected.removed;
|
|
29296
29296
|
addedCols = detected.added;
|
|
29297
29297
|
}
|
|
29298
|
-
if (preserveUnknownColumns
|
|
29298
|
+
if (preserveUnknownColumns) {
|
|
29299
29299
|
const preserved = removedCols.map((name) => prevCols[name]);
|
|
29300
|
-
const
|
|
29301
|
-
|
|
29302
|
-
|
|
29303
|
-
|
|
29304
|
-
|
|
29305
|
-
|
|
29300
|
+
const keptIndexes = prev.indexes.filter((idx) => !currIdx[indexKey(idx, prev.table)]);
|
|
29301
|
+
if (preserved.length > 0 || keptIndexes.length > 0) {
|
|
29302
|
+
if (preserved.length > 0) {
|
|
29303
|
+
info2(`-- Keeping ${preserved.length} column(s) on "${curr.table}" no model declares: ${removedCols.join(", ")} \u2014 reconciled from the database, where an undeclared column is out of scope rather than removed`);
|
|
29304
|
+
}
|
|
29305
|
+
if (keptIndexes.length > 0) {
|
|
29306
|
+
info2(`-- Keeping ${keptIndexes.length} index(es) on "${curr.table}" no model declares: ${keptIndexes.map((index) => index.name).join(", ")} \u2014 reconciled from the database, where an undeclared index is out of scope rather than removed`);
|
|
29307
|
+
}
|
|
29308
|
+
curr = { ...curr, columns: [...curr.columns, ...preserved], indexes: [...curr.indexes, ...keptIndexes] };
|
|
29309
|
+
currCols = mapColumnsByName(curr.columns);
|
|
29310
|
+
currIdx = mapIndexesByKey(curr.indexes, curr.table);
|
|
29311
|
+
}
|
|
29306
29312
|
removedCols = [];
|
|
29307
29313
|
}
|
|
29308
29314
|
const modifiedCols = Object.keys(currCols).filter((n2) => prevCols[n2] && columnsAreDifferent(prevCols[n2], currCols[n2], dialect));
|
package/package.json
CHANGED