Closed lewismoten closed 2 months ago
Also of note, running migration.js refresh
will also hang if the database does not have any migration timestamps since it also calls the same down_migrations
function.
Closing as this duplicates #17 . Please see the cause and fix in my original comment.
Keep running
migration.js down
to revert all migrations. Eventually you'll have a database without any values inmysql_migrations_347ertt3e
. Runmigration.js down
one more time. The script will hang.The problem appears to be due to the lack of a callback function if the query for timestamps in the database is zero. I see a truthy statement to perform some logic to execute queries if the database still has timestamps - but I don't see an else statement.
https://github.com/kawadhiya21/mysql-migrations/blob/65c52086c766d5c91508ba66c3b811682484c4b2/core_functions.js#L91
My proposal is to add an else condition that writes a message to the console indicating that the database does not have anymore migrations to rollback, and to call the
cb()
function.