Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error message for missing migration files #4937

Merged
merged 1 commit into from Jan 17, 2022

Conversation

vpontis
Copy link
Contributor

@vpontis vpontis commented Jan 17, 2022

This was caused by this change 1.0

Changed Migrator to return list of migrations as objects consistently.

I'm not sure how / if I should add tests for this. Let me know if you'd like them :)

This fixes the following error:

$ (createdb luma-test &> /dev/null || true) && knex migrate:latest --env test && node -r esbuild-register ./node_modules/knex/bin/cli.js seed:run --env test --specific=seed_db.ts && NODE_ENV=test jest --runInBand
Using environment: test
The migration directory is corrupt, the following files are missing: [object Object]
Error: The migration directory is corrupt, the following files are missing: [object Object]
    at validateMigrationList (/Users/victor/Code/luma/node_modules/.pnpm/knex@1.0.1_pg@8.7.1/node_modules/knex/lib/migrations/migrate/Migrator.js:566:11)
    at Migrator.latest (/Users/victor/Code/luma/node_modules/.pnpm/knex@1.0.1_pg@8.7.1/node_modules/knex/lib/migrations/migrate/Migrator.js:69:7)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Command.<anonymous> (/Users/victor/Code/luma/node_modules/.pnpm/knex@1.0.1_pg@8.7.1/node_modules/knex/bin/cli.js:232:32)

This was caused by this change 1.0

> Changed Migrator to return list of migrations as objects consistently.

I'm not sure how / if I should add tests for this. Let me know if you'd like them :)

This fixes the following error:

```
$ (createdb luma-test &> /dev/null || true) && knex migrate:latest --env test && node -r esbuild-register ./node_modules/knex/bin/cli.js seed:run --env test --specific=seed_db.ts && NODE_ENV=test jest --runInBand
Using environment: test
The migration directory is corrupt, the following files are missing: [object Object]
Error: The migration directory is corrupt, the following files are missing: [object Object]
    at validateMigrationList (/Users/victor/Code/luma/node_modules/.pnpm/knex@1.0.1_pg@8.7.1/node_modules/knex/lib/migrations/migrate/Migrator.js:566:11)
    at Migrator.latest (/Users/victor/Code/luma/node_modules/.pnpm/knex@1.0.1_pg@8.7.1/node_modules/knex/lib/migrations/migrate/Migrator.js:69:7)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Command.<anonymous> (/Users/victor/Code/luma/node_modules/.pnpm/knex@1.0.1_pg@8.7.1/node_modules/knex/bin/cli.js:232:32)
```
@kibertoad kibertoad merged commit e171d61 into knex:master Jan 17, 2022
@kibertoad
Copy link
Collaborator

Thank you!

@kibertoad
Copy link
Collaborator

Released in 1.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants