Hey there, does anyone have a pattern for running sql migrations as part of the deploy process? We run a Aurora Serverless Postgres DB and would love to run db migrations from our SST app
t
thdxr
10/05/2021, 6:12 PM
lol @Frank
thdxr
10/05/2021, 6:13 PM
We were just talking about whether people are using Aurora Serverless
thdxr
10/05/2021, 6:13 PM
Turns out they are! For your situation, what tool are you using to manage pg migrations?
thdxr
10/05/2021, 6:14 PM
If you want to fully automate it, you can use this construct to run a function that executes your migrations after deploy: https://docs.serverless-stack.com/constructs/Script
However, after trying out that pattern I personally decided running migrations manually from my machine was better in the short term
m
Michael Orcutt
10/05/2021, 7:00 PM
We are currently running migrations from our own machines as well
p
Phil Astle
10/05/2021, 10:02 PM
We use Script to create the tables and seed some initial data. As part of that we have a bit of version info about the table schema in there - theory being we could do upgrades to the schema potentially via the same script in the future. It's a new product under development though so how well this idea will work I couldn't say yet..!
m
Michael Orcutt
10/05/2021, 10:04 PM
Awesome @thdxr@Phil that is really helpful. Glad to hear someone is doing it in practice