rake-db 2.19.0 → 2.20.0

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
@@ -3087,15 +3087,6 @@ const migrationConfigDefaults = {
3087
3087
  migrationsTable: "schemaMigrations",
3088
3088
  snakeCase: false,
3089
3089
  commands: {},
3090
- import: (path2) => {
3091
- return import(path2).catch((err) => {
3092
- if (err.code === "ERR_UNKNOWN_FILE_EXTENSION") {
3093
- require(path2);
3094
- } else {
3095
- throw err;
3096
- }
3097
- });
3098
- },
3099
3090
  log: true,
3100
3091
  logger: console
3101
3092
  };
@@ -4039,7 +4030,7 @@ const makeStructureToAstCtx = (config, currentSchema) => ({
4039
4030
  columnSchemaConfig: config.schemaConfig,
4040
4031
  columnsByType: makeColumnsByType(config.schemaConfig)
4041
4032
  });
4042
- const structureToAst = async (ctx, adapter) => {
4033
+ const structureToAst = async (ctx, adapter, config) => {
4043
4034
  const ast = [];
4044
4035
  const data = await introspectDbSchema(adapter);
4045
4036
  for (const name of data.schemas) {
@@ -4061,7 +4052,7 @@ const structureToAst = async (ctx, adapter) => {
4061
4052
  }
4062
4053
  const domains = makeDomainsMap(ctx, data);
4063
4054
  for (const table of data.tables) {
4064
- if (table.name === "schemaMigrations")
4055
+ if (table.name === config.migrationsTable)
4065
4056
  continue;
4066
4057
  ast.push(tableToAst(ctx, data, table, "create", domains));
4067
4058
  }
@@ -5160,7 +5151,7 @@ const pullDbStructure = async (options, config) => {
5160
5151
  const adapter = new Adapter(options);
5161
5152
  const currentSchema = adapter.schema || "public";
5162
5153
  const ctx = makeStructureToAstCtx(config, currentSchema);
5163
- const ast = await structureToAst(ctx, adapter);
5154
+ const ast = await structureToAst(ctx, adapter, config);
5164
5155
  await adapter.close();
5165
5156
  const result = astToMigration(currentSchema, config, ast);
5166
5157
  if (!result)
@@ -5523,7 +5514,7 @@ var __spreadValues = (a, b) => {
5523
5514
  }
5524
5515
  return a;
5525
5516
  };
5526
- const rakeDb = (options, partialConfig = {}, args = process.argv.slice(2)) => {
5517
+ const rakeDb = (options, partialConfig, args = process.argv.slice(2)) => {
5527
5518
  const config = processRakeDbConfig(partialConfig);
5528
5519
  const promise = runCommand(
5529
5520
  options,
@@ -5541,7 +5532,7 @@ const rakeDb = (options, partialConfig = {}, args = process.argv.slice(2)) => {
5541
5532
  promise
5542
5533
  });
5543
5534
  };
5544
- rakeDb.lazy = (options, partialConfig = {}) => {
5535
+ rakeDb.lazy = (options, partialConfig) => {
5545
5536
  const config = processRakeDbConfig(partialConfig);
5546
5537
  return {
5547
5538
  change,