orchid-orm 1.59.2 → 1.59.3
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 +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/migrations/node-postgres.js +3 -3
- package/dist/migrations/node-postgres.js.map +1 -1
- package/dist/migrations/node-postgres.mjs +4 -4
- package/dist/migrations/node-postgres.mjs.map +1 -1
- package/dist/migrations/postgres-js.js +3 -3
- package/dist/migrations/postgres-js.js.map +1 -1
- package/dist/migrations/postgres-js.mjs +4 -4
- package/dist/migrations/postgres-js.mjs.map +1 -1
- package/dist/node-postgres.d.ts +1 -1
- package/dist/node-postgres.js +6 -2
- package/dist/node-postgres.js.map +1 -1
- package/dist/node-postgres.mjs +6 -2
- package/dist/node-postgres.mjs.map +1 -1
- package/dist/postgres-js.d.ts +1 -1
- package/dist/postgres-js.js +2 -1
- package/dist/postgres-js.js.map +1 -1
- package/dist/postgres-js.mjs +2 -1
- package/dist/postgres-js.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promptSelect, getSchemaAndTableFromName, getDbTableColumnsChecks, dbColumnToAst, instantiateDbColumn, concatSchemaAndName, encodeColumnDefault, getIndexName, getExcludeName, getConstraintName, tableToAst, getDbStructureTableData, makeDomainsMap, astToMigration, createMigrationInterface, introspectDbSchema, makeStructureToAstCtx, makeFileVersion, writeMigrationFile, migrateAndClose, migrate, structureToAst, saveMigratedVersion, rakeDbCommands } from 'rake-db';
|
|
2
|
-
import { colors, EnumColumn, ArrayColumn, toSnakeCase, getColumnBaseType, deepCompare,
|
|
2
|
+
import { colors, EnumColumn, ArrayColumn, toSnakeCase, getColumnBaseType, deepCompare, RawSql, emptyArray, toArray, getFreeSetAlias, VirtualColumn, exhaustive, toCamelCase, addCode, pluralize, codeToString, DomainColumn, UnknownColumn, defaultSchemaConfig, toPascalCase, getImportPath, singleQuote, columnsShapeToCode, pushTableDataCode, quoteObjectKey, pathToLog } from 'pqb';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { pathToFileURL } from 'url';
|
|
5
5
|
import fs from 'fs/promises';
|
|
@@ -511,7 +511,7 @@ const compareColumns = async (adapter, domainsMap, ast, currentSchema, compareSq
|
|
|
511
511
|
)) {
|
|
512
512
|
return "change";
|
|
513
513
|
}
|
|
514
|
-
if (dbData.default !== void 0 &&
|
|
514
|
+
if (dbData.default !== void 0 && codeData.default !== void 0) {
|
|
515
515
|
const valuesBeforeLen = compareSql.values.length;
|
|
516
516
|
const dbDefault = encodeColumnDefault(
|
|
517
517
|
dbData.default,
|
|
@@ -670,7 +670,7 @@ const processDomains = async (ast, adapter, domainsMap, dbStructure, {
|
|
|
670
670
|
);
|
|
671
671
|
if (domain.checks) {
|
|
672
672
|
dbColumn.data.checks = domain.checks.map((check) => ({
|
|
673
|
-
sql: new
|
|
673
|
+
sql: new RawSql([[check]])
|
|
674
674
|
}));
|
|
675
675
|
}
|
|
676
676
|
const dbDomain = makeComparableDomain(
|
|
@@ -1810,7 +1810,7 @@ const collectCodeChecks = ({
|
|
|
1810
1810
|
};
|
|
1811
1811
|
const dropCheck = ({ changeTableAst: { drop }, changingColumns }, dbCheck, name) => {
|
|
1812
1812
|
var _a;
|
|
1813
|
-
const sql = new
|
|
1813
|
+
const sql = new RawSql([
|
|
1814
1814
|
[dbCheck.expression]
|
|
1815
1815
|
]);
|
|
1816
1816
|
if (dbCheck.columns?.length === 1 && changingColumns[dbCheck.columns[0]]) {
|