sql

Khan 2024-03-12T06:21:06.410329Z

Hello everyone, How do you guys manage migrations on your database?

valerauko 2024-03-12T15:14:58.184429Z

ragtime

seancorfield 2024-03-12T17:02:37.209269Z

We built our own system back in 2011 but if we were starting over now we'd probably use https://github.com/yogthos/migratus

Khan 2024-03-13T06:37:54.523379Z

Migratus seems cool.

Khan 2024-03-13T06:38:00.502669Z

Thanks

2024-03-13T14:45:44.023419Z

MyBatis Migrations https://gist.github.com/geraldodev/f4cc25376331ebd37d2eb8a4d3ccf8a9

DenisMc 2024-03-16T07:17:29.338999Z

Ragtime works well for us for our cloud-deployed system. For production, we have a clojure tools.build function that we can run from the command line that updates the db - it is run from GitHub actions. We have a policy that db updates should be backwards compatible (I.e. we should be able to apply the latest db updates to production without breaking anything) - this allows us to separate db updates from code updates. As part of this overall build process, we run the tests from the git sha for the currently live version of our code against the new db schema (again in GitHub actions) to ensure that backwards compatibility.

seancorfield 2024-03-16T16:48:59.626549Z

Yeah, we have much the same setup (backward compatible, ability to run migrations separately if we need to). We actually build (& run) an uberjar that contains the migrations for each round of changes so it can be auto-deployed using the same machinery as everything else.