rake-db 2.36.12 → 2.36.14

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
@@ -1734,8 +1734,8 @@ declare const concatSchemaAndName: ({
1734
1734
  schema?: string;
1735
1735
  name: string;
1736
1736
  }, excludeCurrentSchema?: string) => string;
1737
- interface RakeDbChangeFnConfig {
1738
- columnTypes: unknown;
1737
+ interface RakeDbChangeFnConfig<ColumnTypes> {
1738
+ columnTypes: ColumnTypes;
1739
1739
  }
1740
1740
  /**
1741
1741
  * Function to use in migrations to wrap database changes
@@ -1745,10 +1745,10 @@ interface RakeDbChangeFnConfig {
1745
1745
  interface MigrationChangeFn<ColumnTypes> {
1746
1746
  (fn: ChangeCallback<ColumnTypes>): MigrationChange;
1747
1747
  }
1748
- declare const createMigrationChangeFn: <ColumnTypes>(config: RakeDbChangeFnConfig) => MigrationChangeFn<ColumnTypes>;
1748
+ declare const createMigrationChangeFn: <ColumnTypes>(config: RakeDbChangeFnConfig<ColumnTypes>) => MigrationChangeFn<ColumnTypes>;
1749
1749
  interface MigrationChange {
1750
1750
  fn: ChangeCallback<unknown>;
1751
- config: RakeDbChangeFnConfig;
1751
+ config: RakeDbChangeFnConfig<unknown>;
1752
1752
  }
1753
1753
  type ChangeCallback<ColumnTypes> = (db: DbMigration<ColumnTypes>, up: boolean) => Promise<void>;
1754
1754
  interface OrmParam {
package/dist/index.js CHANGED
@@ -3220,18 +3220,19 @@ async function renameMigrations(config, trx, versions, renameTo) {
3220
3220
  await renameMigrationVersionsInDb(config, trx, values);
3221
3221
  return updatedVersions;
3222
3222
  }
3223
- const migrateConfigDefaults = {
3224
- migrationId: { serial: 4 },
3225
- migrationsTable: "schemaMigrations",
3226
- transaction: "single"
3227
- };
3228
3223
  const handleConfigLogger = (config, db) => {
3229
3224
  const q = db ? "$qb" in db && db.$qb ? db.$qb.q : "q" in db ? db.q : void 0 : void 0;
3225
+ const queryLogger = q?.log && q.logger;
3230
3226
  return {
3231
3227
  log: config.log ?? q?.log,
3232
- logger: config.log === true ? config.logger || q?.logger || console : config.log === false ? void 0 : config.logger || q?.logger
3228
+ logger: config.log === true ? config.logger || queryLogger || console : config.log === false ? void 0 : config.logger || queryLogger
3233
3229
  };
3234
3230
  };
3231
+ const migrateConfigDefaults = {
3232
+ migrationId: { serial: 4 },
3233
+ migrationsTable: "schemaMigrations",
3234
+ transaction: "single"
3235
+ };
3235
3236
  /**
3236
3237
  * Process a PublicRakeDbConfig into RakeDbConfig by handling the `log` option.
3237
3238
  * This is used by public migration functions (migrate, rollback, redo) to