4 ms·
I use https://github.com/ariga/atlas https://github.com/ariga/atlas for this, migration based and schema base both has there good and bad side, I prefer both ev
by wener 8mo ago
I use https://github.com/ariga/atlas https://github.com/ariga/atlas for this, migration based and schema base both has there good and bad side, I prefer both even in one project, schema based can make dev faster, eaiser, migration based make feel reliable.
- a8m 8mo agoAriel from Atlas here. This setup is pretty common (declarative locally, versioned in real environments). Since migrations are auto-generated (by Atlas) on PRs, most developers never touch the versioned workflow directly. See: https://atlasgo.io/concepts/declarative-vs-versioned#combining-declarative-and-versioned-workflows https://atlasgo.io/concepts/declarative-vs-versioned#combini..., and https://github.com/ariga/atlas-action?tab=readme-ov-file#arigaatlas-actionmigratediff https://github.com/ariga/atlas-action?tab=readme-ov-file#ari...
- gwking 8mo agoI wrote a very rudimentary schema and automatic migration system for SQLite. One problem that I ran into recently was deploying changes that spanned two migrations, because the tool doesn’t know how to step through commits to do successive auto-migrations between schema versions. I guess there are rather obvious ways to handle this if you generate and then commit the full migration sql for each schema change. Nonetheless I’m curious if this is a problem you have had to think about, if you find it interesting or if it sounds like a bad path to go down, and if atlas does anything smart in this department. Thanks in advance!
- Palmik 8mo agoYeah, after looking more into sqldef and alternatives I stumbled on Atlas too and I like the explicit support for migration based flow for exactly the same reasons. I want to know exactly what kind of migration will be applied to my prod database beforehand.