Search code examples
ruby-on-railsruby-on-rails-3database-migration

Rails: compile migrations into one file


We've been developing an application for a year and there are some errors in the migrations. Is there a way to compile them into one file so that we can eliminate any errors and the like without sorting through hundreds of individual files? Or can we reset the migrations so the version running right now is the first for new installations?


Solution

  • Migrations are already "compile" into one file call schema.rb located into the db folder of your rails application.

    You can load the schema from the following rake task:

    rake db:schema:load