Fork me on GitHub

Does anyone know how to run down migrations in production profile ? I'm using duct.migrator.ragtime for running migrations.


Thank you. I did try that, but it gave an error for some reason.


It work fine in development using sqlite db, but when I tried it in production i had issues. I had forgotten to set my table column as primary and when I changed it in the migration section of config and ran :duct/migrate , I got an error. I had to drop the table and run migration again


Also, the docs don't say how to rollback a migration.. is it possible ?


Ah..i found this in the blog "Advancing Duct" - In the development environment, the old migration is rolled back and the new one applied. In a production environment an error would be raised instead; in production, we only migrate, we don't rollback.


So in production, you might write your DROP TABLE ... stuff in an .up.sql-migration. An advantage of that is that you have the full history of your system. If you don't care about the database content, you can allways drop the whole database and migrate from 0.


Thank you. Yeah this is not for production use. It's something I'm tryout out to learn the framework. Will try you suggestion