This project is archived and is in readonly mode.
db:migrate:down does not remove migration version from schema_migrations table
Reported by RaceCondition | June 8th, 2008 @ 09:27 AM | in 2.1.1
When running rake db:migrate:down VERSION=someversion, them someversion is not removed from the contents of the schema_migrations table. So when rake db:migrate is run, someversion will not be reapplied any more.
The workaround is to manually remove the version from schema_migrations.
Here's a complete moron's guide how to reproduce the problem:
Comments and changes to this ticket
-
Jeremy Kemper June 8th, 2008 @ 09:28 AM
- Milestone set to 2.1.1
-
RaceCondition June 8th, 2008 @ 09:37 AM
Forgot to mention that I have verified this bug with both MySQL 5 and SQLite.
-
Michael Raidel June 13th, 2008 @ 03:33 PM
"rake db:migrate:down" runs "ActiveRecord::Migrator.run(:down,...)" This in turn calls the #run instance method on a new Migrator instance and this method doesn't record its state in the schema_migrations-table. There is even one test which makes it look like this is the wanted behaviour, so I am not completely sure if I am going in the right direction. I have attached a patch which also adds two tests for the up and down-method and removes the test_migrator_run-test which seems to assume this is the right behaviour.
-
Jeremy Kemper June 16th, 2008 @ 12:26 PM
- State changed from new to open
- Assigned user set to Jeremy Kemper
-
Repository June 23rd, 2008 @ 02:17 AM
- State changed from open to resolved
(from [7839a83227d0d7cb193f0599afc03829d4643a64]) ActiveRecord::Migrator#run records version-state after migrating. [#369 state:resolved]
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>