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

DM-41028: Add schema version support and check to SQL backend #41

Merged
merged 7 commits into from Jan 24, 2024

Conversation

andy-slac
Copy link
Collaborator

Apdb now understands metadata table specification in sdm_schemas. Apdb now verifies that its own version and schema version in sdm_schemas are compatible with the versions stored in metadata table. Both metadata table and sdm_schemas version numbers are optional, if they are missing they are assumed to be "0.1.0".

Copy link

@ebellm ebellm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good--just one small comment in a spot I got confused.

return VersionTuple.fromString(version_str)
return default

initial_version = VersionTuple(0, 1, 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was confused why this wasn't VERSION, so a comment pointing out that this is used to specify versions in old schemas when the metadata is not present would be helpful.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I'll add a comment.

Apdb class now has an associated version number and schema version number
(latter comes from YAML schema). Both version numbers are stored in
metadata table when schema is initialized. Versions are read when
ApdbSql is instantiated and version numbers are compared to what is
defined in YAML and in the code.
Also improved handling of empty schema in SQL backend.
@andy-slac andy-slac merged commit 011c388 into main Jan 24, 2024
6 checks passed
@andy-slac andy-slac deleted the tickets/DM-41028 branch January 24, 2024 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants