rake-db 2.4.19 → 2.4.20
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.js +2 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { quote, getRaw, EnumColumn, UnknownColumn, columnTypes, getColumnTypes, getTableData, ColumnType, resetTableData, TransactionAdapter, logParamToLogObject, createDb as createDb$1, Adapter, columnsByType, instantiateColumn, DomainColumn, CustomTypeColumn, ArrayColumn,
|
|
1
|
+
import { quote, getRaw, EnumColumn, UnknownColumn, columnTypes, getColumnTypes, getTableData, ColumnType, resetTableData, TransactionAdapter, logParamToLogObject, createDb as createDb$1, Adapter, columnsByType, instantiateColumn, DomainColumn, CustomTypeColumn, ArrayColumn, primaryKeyToCode, indexToCode, foreignKeyToCode, TimestampColumn, foreignKeyArgsToCode } from 'pqb';
|
|
2
2
|
import { singleQuote, toSnakeCase, isRaw, toArray, snakeCaseKey, nameKey, emptyObject, pathToLog, raw, toCamelCase, codeToString, addCode, rawToCode, quoteObjectKey } from 'orchid-core';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { readdir, mkdir, writeFile } from 'fs/promises';
|
|
@@ -2105,11 +2105,6 @@ var __objRest = (source, exclude) => {
|
|
|
2105
2105
|
}
|
|
2106
2106
|
return target;
|
|
2107
2107
|
};
|
|
2108
|
-
class RakeDbEnumColumn extends EnumColumn {
|
|
2109
|
-
toCode(t) {
|
|
2110
|
-
return columnCode(this, t, `enum('${this.enumName}')`);
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
2108
|
const matchMap = {
|
|
2114
2109
|
s: void 0,
|
|
2115
2110
|
f: "FULL",
|
|
@@ -2302,7 +2297,7 @@ const getColumn = (ctx, data, domains, _a) => {
|
|
|
2302
2297
|
(item) => item.name === type && item.schemaName === typeSchema
|
|
2303
2298
|
);
|
|
2304
2299
|
if (enumType) {
|
|
2305
|
-
column = new
|
|
2300
|
+
column = new EnumColumn({}, type, enumType.values);
|
|
2306
2301
|
} else {
|
|
2307
2302
|
column = new CustomTypeColumn({}, type);
|
|
2308
2303
|
((_b2 = (_a2 = ctx.unsupportedTypes)[type]) != null ? _b2 : _a2[type] = []).push(
|
|
@@ -2570,7 +2565,7 @@ const createTable = (config, ast) => {
|
|
|
2570
2565
|
if (hasTimestamps && (key === "createdAt" || key === "updatedAt"))
|
|
2571
2566
|
continue;
|
|
2572
2567
|
const line = [`${quoteObjectKey(key)}: `];
|
|
2573
|
-
for (const part of ast.shape[key].toCode("t")) {
|
|
2568
|
+
for (const part of ast.shape[key].toCode("t", true)) {
|
|
2574
2569
|
addCode(line, part);
|
|
2575
2570
|
}
|
|
2576
2571
|
addCode(line, ",");
|