Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema versioning for Sql Storage #649

Closed
3 tasks
bpkroth opened this issue Jan 23, 2024 · 2 comments · Fixed by #906
Closed
3 tasks

Schema versioning for Sql Storage #649

bpkroth opened this issue Jan 23, 2024 · 2 comments · Fixed by #906
Assignees
Labels
enhancement New feature or request mlos-bench

Comments

@bpkroth
Copy link
Contributor

bpkroth commented Jan 23, 2024

  • 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 bpkroth self-assigned this Jan 23, 2024
@bpkroth bpkroth added enhancement New feature or request mlos-bench labels Jan 23, 2024
@bpkroth
Copy link
Contributor Author

bpkroth commented Jan 26, 2024

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

@bpkroth
Copy link
Contributor Author

bpkroth commented Jan 26, 2024

Note:

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

motus added a commit that referenced this issue Jan 26, 2024
#628 mistakenly included an early attempt at adding
`optimization_target` and `optimization_direction` to the `experiment`
table in the `mlos_bench.storage.sql` backend.

In that PR we later moved it to its own `objectives` table to eventually
support multi-objectives.

Nothing accesses those columns now, however including them in the
metadata makes it impossible to load storage backends previously created
with the old schema since adjusting columns with sqlalchemy's
`create_all()` API only considers table existence.

On the contrary, the latter means that we will automatically support old
storage backends with the new code for the `objectives` table.

Removing these two columns in the `metadata` schema description simply
allows that to proceed without error.

See Also: #649

Co-authored-by: Sergiy Matusevych <sergiym@microsoft.com>
@bpkroth bpkroth closed this as completed in 43cc81a Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mlos-bench
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant