Simple tactic for migrations beyond migrate
Make use of Rake in your miscellaneous migration tasks. Migrations are geared for database changes all or nothing is best since backtracking always is risky. Add your own application rake tasks to handle additional record creation, default settings, app specific stuff. Model classes are best for methods since you can test on console and tinker, but once you are there, a rake lib gives better control for the task at hand, lets you add on tasks without affecting the app core. All deployments I’ve used have handles to rake which can be used on demand.
Advertisement