orchid-orm 1.56.5 → 1.57.1
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 +15 -5
- package/dist/index.js +13 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -15
- package/dist/index.mjs.map +1 -1
- package/dist/migrations/node-postgres.js +5 -21
- package/dist/migrations/node-postgres.js.map +1 -1
- package/dist/migrations/node-postgres.mjs +6 -22
- package/dist/migrations/node-postgres.mjs.map +1 -1
- package/dist/migrations/postgres-js.js +5 -21
- package/dist/migrations/postgres-js.js.map +1 -1
- package/dist/migrations/postgres-js.mjs +6 -22
- package/dist/migrations/postgres-js.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -1284,7 +1284,7 @@ const collectCodeComparableItemsType = (config, codeItems, key) => {
|
|
|
1284
1284
|
...codeItem.options,
|
|
1285
1285
|
include: codeItem.options.include === void 0 ? void 0 : config.snakeCase ? orchidCore.toArray(codeItem.options.include).map(orchidCore.toSnakeCase) : orchidCore.toArray(codeItem.options.include),
|
|
1286
1286
|
columns: codeItem.columns,
|
|
1287
|
-
name: codeItem.name,
|
|
1287
|
+
name: codeItem.options.name,
|
|
1288
1288
|
columnKeys: codeItem.columnKeys,
|
|
1289
1289
|
includeKeys: codeItem.includeKeys
|
|
1290
1290
|
});
|
|
@@ -1416,8 +1416,7 @@ const handleItemChange = ({
|
|
|
1416
1416
|
const column = changingColumns[dbColumn.column];
|
|
1417
1417
|
if (column) {
|
|
1418
1418
|
((_a = column.from.data)[key] ?? (_a[key] = [])).push({
|
|
1419
|
-
options: dbItem,
|
|
1420
|
-
name,
|
|
1419
|
+
options: { ...dbItem, name },
|
|
1421
1420
|
with: key === "indexes" ? void 0 : dbColumn.with
|
|
1422
1421
|
});
|
|
1423
1422
|
return;
|
|
@@ -1425,8 +1424,7 @@ const handleItemChange = ({
|
|
|
1425
1424
|
}
|
|
1426
1425
|
((_b = changeTableAst.drop)[key] ?? (_b[key] = [])).push({
|
|
1427
1426
|
columns: dbColumns,
|
|
1428
|
-
options: dbItem,
|
|
1429
|
-
name
|
|
1427
|
+
options: { ...dbItem, name }
|
|
1430
1428
|
});
|
|
1431
1429
|
} else if (rename) {
|
|
1432
1430
|
delayedAst.push({
|
|
@@ -1783,14 +1781,7 @@ const collectCodeChecks = ({
|
|
|
1783
1781
|
const baseName = `${codeTable.table}_${columnName}_check`;
|
|
1784
1782
|
codeChecks.push(
|
|
1785
1783
|
...column.data.checks.map((check) => {
|
|
1786
|
-
|
|
1787
|
-
if (!name) {
|
|
1788
|
-
name = baseName;
|
|
1789
|
-
let n = 0;
|
|
1790
|
-
while (names.has(name)) {
|
|
1791
|
-
name = baseName + ++n;
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1784
|
+
const name = check.name || orchidCore.getFreeSetAlias(names, baseName, 1);
|
|
1794
1785
|
names.add(name);
|
|
1795
1786
|
return {
|
|
1796
1787
|
check,
|
|
@@ -1805,14 +1796,7 @@ const collectCodeChecks = ({
|
|
|
1805
1796
|
const { check } = constraint;
|
|
1806
1797
|
if (check) {
|
|
1807
1798
|
const baseName = `${codeTable.table}_check`;
|
|
1808
|
-
|
|
1809
|
-
if (!name) {
|
|
1810
|
-
name = baseName;
|
|
1811
|
-
let n = 0;
|
|
1812
|
-
while (names.has(name)) {
|
|
1813
|
-
name = baseName + ++n;
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1799
|
+
const name = constraint.name || orchidCore.getFreeSetAlias(names, baseName, 1);
|
|
1816
1800
|
names.add(name);
|
|
1817
1801
|
codeChecks.push({
|
|
1818
1802
|
check: { sql: check, name: constraint.name },
|