I have a database set up for my Rails installation and some migrations set up. I would like to be able to reset my database back down to having no tables/constraints/etc., but can't find a reasonable way to do this without knowing the number of migrations or the timestamp of the first migration. Here are my options as I see them:
rake db:migrate:reset
rake db:migrate:down VERSION=20090701154839
where 20090701154839 is the timestamp associated with the first migrationrake db:migrate:rollback STEP=15
where there have been 15 migrations
The problem with db:migrate:reset
is that it drops the database first (it does db:drop
, db:create
, then db:migrate
).
The problem with db:migrate:down
is that I don't want to encode the VERSION of the beginning.
The problem with db:migrate:rollback
is that I don't know the number of steps it is back to the beginning.
What are my options?