Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DDL + DML in Flyway (recommended approach)

We're currently running Flyway to handle DDL and DML changes bundled together in .sql files.

We'd like to treat them seperately (for example, as .ddl and .dml) and run DDL as the owner schema and DML as user.

What's the recommended approach to running Flyway like this? Is it a typical scenario for Flyway?

We've thought about running two instances of Flyway (one for each) but we imagine we might want to be able to interleave DDL and DML.

like image 860
Toby Avatar asked Jul 14 '14 10:07

Toby


1 Answers

In the spirit of KISS and YAGNI I believe you should keep things as is. The DML is tightly coupled to the current structure defined by the DDL anyway. So why separate them and create unnecessary challenges to keep them in sync?

And if it's risk you're worried about, think again. From a business perspective DML carries the exact same risk as DDL. The minute you have to power to update data, you have the power to destroy it.

Embrace simplicity.

like image 96
Axel Fontaine Avatar answered Oct 05 '22 22:10

Axel Fontaine