rake-db 2.10.21 → 2.10.23

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.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { columnTypes, quote, EnumColumn, getColumnTypes, getTableData, ColumnType, resetTableData, UnknownColumn, raw, TransactionAdapter, logParamToLogObject, createDb as createDb$1, Adapter, simplifyColumnDefault, columnsByType, instantiateColumn, DomainColumn, CustomTypeColumn, ArrayColumn, getConstraintKind, primaryKeyToCode, indexToCode, constraintToCode, referencesArgsToCode, constraintPropsToCode, TimestampTZColumn } from 'pqb';
2
- import { getCallerFilePath, singleQuote, toSnakeCase, isRawSQL, toArray, snakeCaseKey, emptyObject, consumeColumnName, setDefaultLanguage, deepCompare, pathToLog, emptyArray, getImportPath, toCamelCase, codeToString, addCode, quoteObjectKey, backtickQuote } from 'orchid-core';
2
+ import { getCallerFilePath, singleQuote, toSnakeCase, isRawSQL, toArray, snakeCaseKey, emptyObject, consumeColumnName, setDefaultLanguage, ColumnTypeBase, deepCompare, pathToLog, emptyArray, getImportPath, toCamelCase, codeToString, addCode, quoteObjectKey, backtickQuote } from 'orchid-core';
3
3
  import path, { join } from 'path';
4
4
  import { readdir, mkdir, writeFile, stat, readFile } from 'fs/promises';
5
5
  import prompts from 'prompts';
@@ -940,7 +940,10 @@ const makeAst$1 = (up, name, changeData, changeTableData2, options) => {
940
940
  const { comment } = options;
941
941
  const shape = {};
942
942
  for (const key in changeData) {
943
- const item = changeData[key];
943
+ let item = changeData[key];
944
+ if (item instanceof ColumnTypeBase) {
945
+ item = add(item);
946
+ }
944
947
  if ("type" in item) {
945
948
  if (up) {
946
949
  shape[key] = item.type === "change" && item.usingUp ? __spreadProps$2(__spreadValues$3({}, item), { using: item.usingUp }) : item;