If you already wrote some code to be committed to the new branch Then switch the branch again and migrate these down migrations. Roll back every migration up to that NO FILE,ĭiscard all changes in schema.rb/ structure.sql (and model annotations if you have any), Yeah, you must remember the oldest NO FILE migration,
To a different branch only to see something like this?
No need to run and rollback migrations, no need to even think about the extra step - DbSchema compares the schema you want with the schema your database has and applies all necessary changes to the latter. each time you need to change the schema you just change the schema.rb file and commit it to your VCSĪs a result you always have an up-to-date database schema.you create a rake task that loads your schema.rb and tell your favorite deployment tool to run it on each deploy.you make your application load this file as early as possible during the application bootup in development and test environments.you create a schema.rb file where you describe the schema you want in a special DSL.DbSchema is an opinionated database schema management tool that lets you maintain your DB schema with a single ruby file.