Generate SQL Script for temporal schemas?

Hi,

I was setting up temporal locally with a Postgres database and creating the Postgres database schema by running the temporal-sql-tool from the temporalio admin-tools.

My project typically uses flyway for managing all database migrations so I was wondering if there is a way to generate a SQL script with the temporal-sql-tool or another tool instead of updating the database directly. That way I can continue to use flyway for applying the migrations

Thank you

Did you get ever get an answer for this? We are in the same boat as you.

nope, that said. We did do some digging on how temporal’s sql tool works and we ended up putting together our own tooling that extracts the SQL migrations from the admin-tools image and writes them to a SQL migration.

So far that seems to be working for us, I think we have done 3 server upgrades since then with that process. But I don’t think I’m really the right person to recommend if that’s a good process or not.

I think it’s fairly similar though to what I saw in this repo.

It would be really cool if the sql-tool that temporal provides actually had an option to dump the SQL to stdout instead though. That would probably be a better way to go about this.

1 Like