Fork me on GitHub
#duct
<
2020-02-23
>
dwalmeida21:02:11

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

dwalmeida02:02:01

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

dwalmeida02:02:26

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

dwalmeida02:02:08

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

dwalmeida02:02:59

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.

teodorlu14:02:57

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.

dwalmeida21:02:37

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