Reputation: 862
I have been working on a rails app for a while now and want to recreate the model without going through all the migration stages (i.e. from scratch) now that I finally have a final design for how I want it to be built.
How do I do this without having to have to recreate my entire project?
Upvotes: 0
Views: 350
Reputation: 25767
I'm not sure if this is what you want, but you could delete all your migration files and copy everything from db/schema.rb to a new migration.
Upvotes: 0
Reputation: 1914
If I am understanding correctly about what you want,
rake db:reset
will recreate your database from your db/schema.rb. Make sure that you have run all the migrations before running it.
However, rails manage the database using the migration files in db/migrate. Everytime you make changes to the database you will need to do it through them or you will get into trouble. These files should be retained and whenever you deloy your app to a new machine, running db:migrate should be fine.
Upvotes: 1