Fork me on GitHub
#xtdb
<
2023-06-10
>
hifumi12306:06:01

How do people here perform migrations on XTDB databases? I’m debating on a bunch of CLJ files that simply check for presence of entities and run transactions to put any missing ones. But is there something like migratus for XTDB?

lispyclouds07:06:32

Your description suggests more of copying state to another db than migration? XT is schemaless and migrations are about setting the schema correctly. If an entity doesn’t exist, puts won’t fail on XT.

lispyclouds07:06:31

What’s your use case?

hifumi12307:06:54

My use case is ensuring transaction functions I need for my app exist, and if they don’t, add them

hifumi12307:06:04

I know there is no harm running the same ::xt/put transaction multiple times (unless I care about the validity time I guess), but I’d like to be able to “set up” a database once with tx functions im using then use them as needed in my app

lispyclouds07:06:37

Yeah I’d do that assertion in the app startup. Not sure if any existing tools would do that.

👍 2
☝️ 2
lispyclouds07:06:42

I have done kinda similar thing with integrant which sets it up when building the connection

☝️ 2