Schema setup and update jobs for MySQL

I’m trying to deploy Temporal on a Kubernetes cluster using the helm chart. I’m using MySQL as the DB and would like to enable the schema setup and update jobs to setup the required schema.

I ran into an issue with the schema and update jobs and logged with more details. TL;DR : the jobs failed to connect to the DB because the SQL configuration parameters (eg. SQL_USER, SQL_PASSWORD) are not passed as environment variables.

I managed to get this issue addressed in my copy of the helm chart and submitted this PR to address. I then realized that there’s already been a few PRs submitted for this issue.

A couple of open PRs with no responses:

There is also, which is closed and indicating this feature won’t be included, as auto database setup is not considered a production feature.

Can you please clarify if it is desirable to fix these SQL jobs and if not, what is the recommended way for setting up MySQL schemas for production? Doing this in an automated way is a must in my opinion. It’s common to have such automated schema updates with tools like Flyway or Liquibase and the temporal-sql tools seems to be doing something similar.

Thanks for the info and the PR! Agree that we haven’t been doing a great job regarding PRs in the helm charts repo. I’m going through all PRs currently and it will get much better as there is clear ownership of the repo now, so stay tuned for updates :slight_smile:

what is the recommended way for setting up MySQL schemas for production

its to use the sql tool (see readme for create and update commands) so your approach of using temporal-sql-tool via command is a good way imo.