orchid-orm 1.54.1 → 1.55.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 +9 -3
- package/dist/index.js +45 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -34
- package/dist/index.mjs.map +1 -1
- package/dist/migrations.js +12 -12
- package/dist/migrations.js.map +1 -1
- package/dist/migrations.mjs +4 -4
- package/dist/migrations.mjs.map +1 -1
- package/package.json +5 -5
package/dist/migrations.js
CHANGED
|
@@ -89,20 +89,20 @@ const promptCreateOrRename = (kind, name, drop, verifying) => {
|
|
|
89
89
|
}
|
|
90
90
|
const renameMessage = `rename ${kind}`;
|
|
91
91
|
return rakeDb.promptSelect({
|
|
92
|
-
message: `Create or rename ${
|
|
92
|
+
message: `Create or rename ${orchidCore.colors.blueBold(
|
|
93
93
|
name
|
|
94
94
|
)} ${kind} from another ${kind}?`,
|
|
95
95
|
options: [
|
|
96
|
-
`${
|
|
96
|
+
`${orchidCore.colors.greenBold("+")} ${name} ${orchidCore.colors.pale(
|
|
97
97
|
`create ${kind}`.padStart(
|
|
98
98
|
hintPos + renameMessage.length - name.length - 4,
|
|
99
99
|
" "
|
|
100
100
|
)
|
|
101
101
|
)}`,
|
|
102
102
|
...drop.map(
|
|
103
|
-
(d) => `${
|
|
103
|
+
(d) => `${orchidCore.colors.yellowBold("~")} ${d} ${orchidCore.colors.yellowBold(
|
|
104
104
|
"=>"
|
|
105
|
-
)} ${name} ${
|
|
105
|
+
)} ${name} ${orchidCore.colors.pale(
|
|
106
106
|
renameMessage.padStart(
|
|
107
107
|
hintPos + renameMessage.length - d.length - name.length - 8,
|
|
108
108
|
" "
|
|
@@ -460,9 +460,9 @@ const compareColumns = async (adapter, domainsMap, ast, currentSchema, compareSq
|
|
|
460
460
|
const abort = await rakeDb.promptSelect({
|
|
461
461
|
message: `Cannot cast type of ${tableName}'s column ${key} from ${dbType} to ${codeType}`,
|
|
462
462
|
options: [
|
|
463
|
-
`${
|
|
463
|
+
`${orchidCore.colors.yellowBold(
|
|
464
464
|
`-/+`
|
|
465
|
-
)} recreate the column, existing data will be ${
|
|
465
|
+
)} recreate the column, existing data will be ${orchidCore.colors.red(
|
|
466
466
|
"lost"
|
|
467
467
|
)}`,
|
|
468
468
|
`write migration manually`
|
|
@@ -2198,7 +2198,7 @@ const report = (ast, config, currentSchema) => {
|
|
|
2198
2198
|
if (typeof config.log === "object" && config.log.colors === false) {
|
|
2199
2199
|
green = red = yellow = pale = (s) => s;
|
|
2200
2200
|
} else {
|
|
2201
|
-
({ green, red, yellow, pale } =
|
|
2201
|
+
({ green, red, yellow, pale } = orchidCore.colors);
|
|
2202
2202
|
}
|
|
2203
2203
|
for (const a of ast) {
|
|
2204
2204
|
switch (a.type) {
|
|
@@ -2241,7 +2241,7 @@ const report = (ast, config, currentSchema) => {
|
|
|
2241
2241
|
const value = counters[key];
|
|
2242
2242
|
if (value || key === "column") {
|
|
2243
2243
|
summary.push(
|
|
2244
|
-
`${value} ${
|
|
2244
|
+
`${value} ${orchidCore.pluralize(key, value, key === "index" ? "es" : "s")}`
|
|
2245
2245
|
);
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
@@ -2295,7 +2295,7 @@ const report = (ast, config, currentSchema) => {
|
|
|
2295
2295
|
`${yellow("~ rename column")} ${config.snakeCase ? orchidCore.toCamelCase(key) : key} ${yellow("=>")} ${change.name}`
|
|
2296
2296
|
);
|
|
2297
2297
|
} else {
|
|
2298
|
-
|
|
2298
|
+
orchidCore.exhaustive(change.type);
|
|
2299
2299
|
}
|
|
2300
2300
|
}
|
|
2301
2301
|
}
|
|
@@ -2482,7 +2482,7 @@ const report = (ast, config, currentSchema) => {
|
|
|
2482
2482
|
break;
|
|
2483
2483
|
}
|
|
2484
2484
|
default:
|
|
2485
|
-
|
|
2485
|
+
orchidCore.exhaustive(a);
|
|
2486
2486
|
}
|
|
2487
2487
|
}
|
|
2488
2488
|
const result = orchidCore.codeToString(code, "", " ");
|
|
@@ -2587,7 +2587,7 @@ ${msg}`);
|
|
|
2587
2587
|
}
|
|
2588
2588
|
}
|
|
2589
2589
|
if (up) {
|
|
2590
|
-
await rakeDb.
|
|
2590
|
+
await rakeDb.fullMigrate({}, options, config, void 0, adapters);
|
|
2591
2591
|
} else if (!afterPull) {
|
|
2592
2592
|
await closeAdapters(adapters);
|
|
2593
2593
|
}
|
|
@@ -2626,7 +2626,7 @@ const migrateAndPullStructures = async (options, config, afterPull) => {
|
|
|
2626
2626
|
adapters: [afterPull.adapter]
|
|
2627
2627
|
};
|
|
2628
2628
|
}
|
|
2629
|
-
const adapters = await rakeDb.
|
|
2629
|
+
const adapters = await rakeDb.fullMigrate(
|
|
2630
2630
|
{},
|
|
2631
2631
|
options,
|
|
2632
2632
|
config,
|