The behavior of rake db:migrate:down is a little bit unexpected (to me
at least).
If I do this:
$ rake db:version
Current version: 20080930121212
$ rake db:migrate:down VERSION=20080930121212
what happens is the schema in that migration is rolled back, but the
migration version is NOT removed from schema_migrations table. So now
rails thinks the db is at version X (according to schema_migrations),
when it fact its schema is really at version X-1.
Am I missing something obvious here? I would have expected
db:migrate:down to also remove that version from schema_migrations.
Thanks
dwh
On Sep 30, 2:39 pm, Denis H. [email protected] wrote:
The behavior of rake db:migrate:down is a little bit unexpected (to me
at least).
If I do this:
$ rake db:version
Current version: 20080930121212
$ rake db:migrate:down VERSION=20080930121212
what happens is the schema in that migration is rolled back, but the
migration version is NOT removed from schema_migrations table.
$ rake --describe db:migrate:down
rake db:migrate:down
Runs the “down” for a given migration VERSION.
Am I missing something obvious here? I would have expected
db:migrate:down to also remove that version from schema_migrations.
You probably want just “db:migrate” with a specific version:
$ rake db:migrate VERSION=20080930121212