duct

Danny Almeida 2020-02-23T21:44:11.001600Z

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

teodorlu 2020-02-24T14:15:57.003300Z

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.

Danny Almeida 2020-02-24T21:13:37.003700Z

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

2020-02-23T22:38:39.002100Z

Also note this PR: https://github.com/duct-framework/docs/pull/6

Danny Almeida 2020-02-24T02:31:01.002500Z

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

Danny Almeida 2020-02-24T02:32:26.002700Z

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

Danny Almeida 2020-02-24T02:33:08.002900Z

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

Danny Almeida 2020-02-24T02:35:59.003100Z

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.