Timeline for Rails pending migration in rake db:test:prepare
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 1, 2013 at 14:49 | vote | accept | Tyler | ||
Aug 1, 2013 at 7:13 | comment | added | Jaap Haagmans |
Not if it generates an error. rake db:migrate will tell you about the error by printing an error trail and saying "later migrations cancelled". It might seem logical that it would undo the changes and revert to its previous state, but that would be tricky because it doesn't always know what that previous state would be. Consider a migration in which you also process data. Or a migration in which you remove multiple columns. It would have to make assumptions (if it can) and that could leave you with much worse results.
|
|
Jul 31, 2013 at 13:53 | comment | added | Tyler | Won't it roll back the migration and undo the changes if the whole thing doesn't run? | |
Jul 31, 2013 at 13:43 | comment | added | Jaap Haagmans |
An example would be that your table is created nicely, but you made a small typo in the name of a column that should be indexed (using add_index ). The migration isn't finished, but because the table is there, you can't run it again to complete it without fixing it manually.
|
|
Jul 30, 2013 at 13:58 | comment | added | Tyler | What would be an example of improper execution? The model responds exactly how I want in the console. Are there other non-functional (e.g. tracking) operations that can fail but still leave the functionality intact? | |
Jul 30, 2013 at 13:53 | history | answered | Jaap Haagmans | CC BY-SA 3.0 |