temporalite-archived icon indicating copy to clipboard operation
temporalite-archived copied to clipboard

Support migrations between Temporal versions for sqlite db

Open jlegrone opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

When updating Temporalite's underlying temporal server version, the sqlite driver may require migrations in order to be compatible with old sqlite database files.

Describe the solution you'd like

  • Temporalite should ensure that it stops before data corruption issues occur across version upgrades.
  • When a migration is necessary, we should allow this to happen automatically via an opt-in flag.
  • Before running a migration, Temporalite should optionally back up (copy) the existing db file.
  • Consider adding a new subcommand to manage migrations/backups manually rather than at server startup time.

Describe alternatives you've considered

Temporal provides a sql-schema-tool that we could probably invoke outside of Temporalite: https://github.com/temporalio/temporal/blob/release/v1.17.x/tools/sql/README.md

I think adding subcommands and/or flags to temporalite directly should make for a much nicer user experience however.

Additional context

jlegrone avatar Aug 11 '22 20:08 jlegrone