Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails migration one by one

Is there a possibility to run migrations one at a time?

I've got a bunch of migration files and the whole migration runs without problem on my local machine (which use PostgreSQL).

When I deploy (the server uses MySQL), the whole migration does not succeed.

Therefore, I'd like to reset the database and run migrations one by one to see where the inconsistency arises.

P.S. The problem seems to be with pluralization: script can not drop column order_id from table NNN, which in fact contain orders_id column.

like image 479
Andrew Avatar asked Dec 03 '25 16:12

Andrew


1 Answers

Rails 3.0 introduced rake db:forward which accepts a STEP parameter:

rake db:forward STEP=1
like image 187
Stefan Avatar answered Dec 06 '25 07:12

Stefan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!