MLOS icon indicating copy to clipboard operation
MLOS copied to clipboard

Schema versioning for Sql Storage

Open bpkroth opened this issue 1 year ago • 2 comments

  • [ ] Add a schema_version table.
  • [ ] If it doesn't exist, infer version 0
  • [ ] Maintain code that adjusts the tables step by step from version 0 to version N (the latest)
    • (e.g., column renames, table additions, etc.)

bpkroth avatar Jan 23 '24 02:01 bpkroth

Better yet, use this: https://alembic.sqlalchemy.org/en/latest/

bpkroth avatar Jan 26 '24 18:01 bpkroth

Note:

  • table additions are already natively supported via sqlalchemy's create_all() call.
  • it's only column changes that needs additional work.

bpkroth avatar Jan 26 '24 18:01 bpkroth