question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npx knex migrate:list doesn't print a readable list of completed migrations files

See original GitHub issue

Environment

Knex version: 1.0.1 Database + version: PostgreSQL 12.7 OS: macOS 11.6.2

Bug

npx knex migrate:list

produces

[object Object]
[object Object]
[object Object]
No Pending Migration files Found.

Previous version (0.95) listed the filenames of completed migrations:

20220119154150_x.ts 
20220119155840_y.ts 
20220120081602_z.ts 
No Pending Migration files Found.
  1. Error message

No error message, just a bit inconvenient to read 😃

  1. Reduced test code, for example in https://npm.runkit.com/knex or if it needs real database connection to MySQL or PostgreSQL, then single file example which initializes needed data and demonstrates the problem.

Run npx knex migrate:list with at least one completed migration.

I think the fix is to say completed[i].name here https://github.com/knex/knex/blob/1744c8c2655a8362260ba987d706ec3473681a78/bin/utils/migrationsLister.js#L16

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

6reactions
kibertoadcommented, Jan 20, 2022

Will be fixed in 1.0.2, sorry!

5reactions
SteveDeWaldcommented, Feb 14, 2022

I’m on version 1.0.3 and am still encountering the issue.

> npx knex migrate:list
Requiring external module ts-node/register
Found 3 Completed Migration file/files.
[object Object] 
[object Object] 
[object Object] 
No Pending Migration files Found.

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrations | Knex.js
Once you have a knexfile.js, you can use the migration tool to create migration files to the specified directory (default migrations).
Read more >
Knex.js Migrations copy existing data to other table
js migration, copy data from one table to another ? The use case is as follows: I have a table A, which I...
Read more >
find file count including directory linux Code Example
find -maxdepth 1 -type d | while read -r dir; do printf "%s:\t" "$dir" ... a shell script to list all of the...
Read more >
9 Best JavaScript and TypeScript ORMs for 2022 - SitePoint
An ORM library simplifies the job of writing database queries. Learn about nine JS and TypeScript ORMs and how they could help you...
Read more >
Configuration Options | Directus Docs
Environment variables are used for all configuration within a Directus ... By default, Directus will read the .env file located next to your ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found