rake-db 2.20.16 → 2.20.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
@@ -1713,7 +1713,7 @@ declare const primaryKeyToSql: (primaryKey: Exclude<TableData['primaryKey'], und
1713
1713
  /**
1714
1714
  * Type of {@link rakeDb} function
1715
1715
  */
1716
- type RakeDbFn = (<SchemaConfig extends ColumnSchemaConfig, CT>(options: MaybeArray<AdapterOptions>, partialConfig: InputRakeDbConfig<SchemaConfig, CT>, args?: string[]) => RakeDbFnReturns<CT>) & {
1716
+ type RakeDbFn = (<SchemaConfig extends ColumnSchemaConfig, CT = undefined>(options: MaybeArray<AdapterOptions>, partialConfig: InputRakeDbConfig<SchemaConfig, CT>, args?: string[]) => RakeDbFnReturns<CT>) & {
1717
1717
  /**
1718
1718
  * Unlike the original `rakeDb` that executes immediately,
1719
1719
  * `rakeDb.lazy` returns the `run` function to be later called programmatically.
package/dist/index.js CHANGED
@@ -3172,7 +3172,7 @@ const migrationConfigDefaults = {
3172
3172
  }
3173
3173
  };
3174
3174
  const processRakeDbConfig = (config) => {
3175
- var _a, _b;
3175
+ var _a;
3176
3176
  const result = __spreadValues$4(__spreadValues$4({}, migrationConfigDefaults), config);
3177
3177
  if (!result.recurrentPath) {
3178
3178
  result.recurrentPath = path.join(result.migrationsPath, "recurrent");
@@ -3208,13 +3208,13 @@ const processRakeDbConfig = (config) => {
3208
3208
  if ("recurrentPath" in result && !path.isAbsolute(result.recurrentPath)) {
3209
3209
  result.recurrentPath = path.resolve(result.basePath, result.recurrentPath);
3210
3210
  }
3211
- if ("baseTable" in config) {
3212
- const proto = (_b = config.baseTable) == null ? void 0 : _b.prototype;
3213
- result.columnTypes = proto.types || pqb.makeColumnTypes(pqb.defaultSchemaConfig);
3214
- if (proto.snakeCase)
3211
+ if ("baseTable" in config && config.baseTable) {
3212
+ const { types, snakeCase, language } = config.baseTable.prototype;
3213
+ result.columnTypes = types || pqb.makeColumnTypes(pqb.defaultSchemaConfig);
3214
+ if (snakeCase)
3215
3215
  result.snakeCase = true;
3216
- if (proto.language)
3217
- result.language = proto.language;
3216
+ if (language)
3217
+ result.language = language;
3218
3218
  } else {
3219
3219
  const ct = "columnTypes" in config && config.columnTypes;
3220
3220
  result.columnTypes = (typeof ct === "function" ? ct(