sql-migrate icon indicating copy to clipboard operation
sql-migrate copied to clipboard

Print the migration name when errors occur

Open lluchs opened this issue 11 years ago • 4 comments

It currently looks something like this when errors occur while running migrations (using mysql):

Migration failed: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[...]'

It would be helpful if the migration name would be printed as well.

lluchs avatar Sep 24 '14 10:09 lluchs

I just pushed a change to my master branch that provides this: https://github.com/ShawnMilo/sql-migrate/commit/c58ca3b957d799a6d402640a65963f3b1299f69c

However, maybe it would be even better to print each migration as it's about to be run. That way there's more info, and also if it blows up the name of the last migration is clearly the one that broke.

ShawnMilo avatar Oct 02 '14 00:10 ShawnMilo

Also, the command should prints the number of migrations ran so far and those that are yet to run because of the error.

chakrit avatar Aug 06 '15 06:08 chakrit

+1

alecha avatar Apr 11 '16 14:04 alecha

perhaps adding a "verbose" switch and/or configuration would be helpful

opensas avatar Mar 27 '19 07:03 opensas