Schema setup and update jobs for MySQL

Hi,
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 https://github.com/temporalio/helm-charts/issues/310 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:
https://github.com/temporalio/helm-charts/pull/275
https://github.com/temporalio/helm-charts/pull/281

There is also https://github.com/temporalio/helm-charts/pull/167, 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.