rake-db 2.8.16 → 2.8.18

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 CHANGED
@@ -266,6 +266,7 @@ type Db = DbResult<DefaultColumnTypes>;
266
266
  type BaseTable<CT extends ColumnTypesBase> = {
267
267
  name: string;
268
268
  filePath: string;
269
+ nowSQL?: string;
269
270
  new (): {
270
271
  columnTypes: CT;
271
272
  snakeCase?: boolean;
package/dist/index.js CHANGED
@@ -567,13 +567,14 @@ var __objRest$1 = (source, exclude) => {
567
567
  return target;
568
568
  };
569
569
  const createTable$1 = async (migration, up, tableName, options, fn) => {
570
+ var _a;
570
571
  const snakeCase = "snakeCase" in options ? options.snakeCase : migration.options.snakeCase;
571
572
  const types = Object.assign(
572
573
  Object.create(migration.columnTypes),
573
574
  tableMethods
574
575
  );
575
576
  types[orchidCore.snakeCaseKey] = snakeCase;
576
- const shape = pqb.getColumnTypes(types, fn);
577
+ const shape = pqb.getColumnTypes(types, fn, (_a = migration.options.baseTable) == null ? void 0 : _a.nowSQL);
577
578
  const tableData = pqb.getTableData();
578
579
  const ast = makeAst$2(
579
580
  up,
@@ -585,8 +586,8 @@ const createTable$1 = async (migration, up, tableName, options, fn) => {
585
586
  );
586
587
  validatePrimaryKey(ast);
587
588
  const queries = astToQueries$1(ast, snakeCase);
588
- for (const _a of queries) {
589
- const _b = _a, { then } = _b, query = __objRest$1(_b, ["then"]);
589
+ for (const _b of queries) {
590
+ const _c = _b, { then } = _c, query = __objRest$1(_c, ["then"]);
590
591
  const result = await migration.adapter.arrays(query);
591
592
  then == null ? void 0 : then(result);
592
593
  }