Upgrading schema on self hosted Temporal

Hi Team, we self host temporal and we are looking into options on how to upgrade schema whenever there is new community release with schema changes. We’ve identified one option with helm charts - using schema.createDatabase.enabled, schema.setup.enabled and schema.update.enabled. We want to set all these 3 flags to true, on new clusters where db is not created we are hoping createDatabase and schema.create will take care of it and for clusters where db is already present createDatabase schema.create should be no op and schema.update should take care of any schema changes coming part of new community releases. Is my understanding correct here, can all these flags be true at the same time, do we see any caveats here or anything we need to be aware of?

Yes, setting these option to true should have you covered in terms of database versioning. The individual steps are idempotent, so it is safe to “create” the database multiple times.

When it comes to the schema, Temporal builds a changeset based on the recorded schema version in the DB. If new and old schema versions match, the change set will be empty.

–Hardy

1 Like