4 ms·
> Migrations first, not schema first. > Migrations are specified in a declarative format, not in SQL. Strongly disagree about this. Consider how Terraform wor
by Dowwie 3y ago
> Migrations first, not schema first.
> Migrations are specified in a declarative format, not in SQL.
Strongly disagree about this. Consider how Terraform works. You declare what the end state should look like and it decides what the "migrations" should be to get you there (the plan). With a relational DB, we would declare the end-state DDL and execute a "plan" that will derive the migration for you and, preferably, derive corresponding types in whatever language you are using.
- mixedCase 3y agoThe problem is that when you go beyond DDL, or you want to execute backwards incompatible DDL changes, you can no longer make these migrations declaratively.
- seabrookmx 3y agoSQL Server Data Tools (SSDT) does this. It's the biggest thing I've missed after moving to postgres.
- ChymeraXYZ 3y agoHow do you deal with for example with this: New column C C = A + B Drop A, B If I just specify the desired state I get data loss...
- DangitBobby 3y agoGood migration systems like Django's will have escape hatches.
- ChymeraXYZ 3y agoYes but then it's no longer declarative, is it?
- DangitBobby 3y agoI don't mind.
- danaris 3y agoIs absolute purity a requirement?