orchid-orm 1.69.0 → 1.69.2
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 +24 -11
- package/dist/index.js +77 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -35
- package/dist/index.mjs.map +1 -1
- package/dist/migrations/index.js +13 -7
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/index.mjs +13 -7
- package/dist/migrations/index.mjs.map +1 -1
- package/dist/node-postgres.d.ts +5 -4
- package/dist/node-postgres.js +7 -3
- package/dist/node-postgres.js.map +1 -1
- package/dist/node-postgres.mjs +8 -5
- package/dist/node-postgres.mjs.map +1 -1
- package/dist/postgres-js.d.ts +5 -4
- package/dist/postgres-js.js +7 -3
- package/dist/postgres-js.js.map +1 -1
- package/dist/postgres-js.mjs +8 -5
- package/dist/postgres-js.mjs.map +1 -1
- package/package.json +5 -5
package/dist/migrations/index.js
CHANGED
|
@@ -777,9 +777,9 @@ const processIndexesAndExcludes = (config, changeTableData, ast, compareExpressi
|
|
|
777
777
|
const processItems = ({ config, changeTableData, codeComparableItems, codeItems, skipCodeItems, holdCodeItems, wait, ast, compareExpressions }, key) => {
|
|
778
778
|
const { changeTableAst: { shape } } = changeTableData;
|
|
779
779
|
const dbItems = changeTableData.dbTableData[key];
|
|
780
|
-
for (
|
|
780
|
+
for (let dbItem of dbItems) {
|
|
781
781
|
if (dbItem.columns.some((column) => "column" in column && checkForColumnAddOrDrop(shape, column.column))) continue;
|
|
782
|
-
normalizeItem(dbItem);
|
|
782
|
+
dbItem = normalizeItem(dbItem);
|
|
783
783
|
const { found, rename, foundAndHasSql } = findMatchingItem(dbItem, codeComparableItems, codeItems, skipCodeItems, changeTableData.codeTable.table, config, key);
|
|
784
784
|
const { columns: dbColumns } = dbItem;
|
|
785
785
|
if (!foundAndHasSql) {
|
|
@@ -894,24 +894,30 @@ const collectCodeComparableItems = (config, codeItems) => {
|
|
|
894
894
|
};
|
|
895
895
|
};
|
|
896
896
|
const collectCodeComparableItemsType = (config, codeItems, key) => {
|
|
897
|
-
return codeItems[key].map((codeItem) => {
|
|
898
|
-
normalizeItem(codeItem.options);
|
|
897
|
+
return codeItems[key].map((codeItem, i) => {
|
|
898
|
+
const options = normalizeItem(codeItem.options);
|
|
899
|
+
codeItems[key][i] = {
|
|
900
|
+
...codeItem,
|
|
901
|
+
options
|
|
902
|
+
};
|
|
899
903
|
return itemToComparable({
|
|
900
|
-
...
|
|
901
|
-
include:
|
|
904
|
+
...options,
|
|
905
|
+
include: options.include === void 0 ? void 0 : config.snakeCase ? (0, pqb_internal.toArray)(options.include).map(pqb_internal.toSnakeCase) : (0, pqb_internal.toArray)(options.include),
|
|
902
906
|
columns: codeItem.columns,
|
|
903
|
-
name:
|
|
907
|
+
name: options.name,
|
|
904
908
|
columnKeys: codeItem.columnKeys,
|
|
905
909
|
includeKeys: codeItem.includeKeys
|
|
906
910
|
});
|
|
907
911
|
});
|
|
908
912
|
};
|
|
909
913
|
const normalizeItem = (item) => {
|
|
914
|
+
item = { ...item };
|
|
910
915
|
if (item.using) item.using = item.using.toLowerCase();
|
|
911
916
|
if (item.using === "btree") item.using = void 0;
|
|
912
917
|
if (!item.unique) item.unique = void 0;
|
|
913
918
|
if (item.nullsNotDistinct === false) item.nullsNotDistinct = void 0;
|
|
914
919
|
if (item.exclude) for (let i = 0; i < item.columns.length; i++) item.columns[i].with = item.exclude[i];
|
|
920
|
+
return item;
|
|
915
921
|
};
|
|
916
922
|
const itemToComparable = (index) => {
|
|
917
923
|
let hasExpression = false;
|