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 check on startup #143

Open
2 tasks
ericbuckley opened this issue Nov 21, 2024 · 0 comments
Open
2 tasks

schema check on startup #143

ericbuckley opened this issue Nov 21, 2024 · 0 comments
Labels
feature New feature or request qa Technical improvements to increase code quality

Comments

@ericbuckley
Copy link
Collaborator

Summary

On application startup, verify that database tables match the ORM.

Acceptance Criteria

  • A new function that verifies the tables called from the create_sessionmaker function
  • Tests to show that it works (may need to programmatically alter the tables in the test cases to show this)

Details / Tasks

On application startup, the database tables are optionally created. That is, they are only created if they don't exist. It's possible thought that the columns don't align to the ORM state. Enhance the startup procedure to verify that the database columns, name and type, match those specified of the ORM, if there is a mismatch raise a SQLAlchemyError with mismatch details.

Background / Context

Take a look at sqlalchemy.inspect for getting table information.

@ericbuckley ericbuckley added feature New feature or request qa Technical improvements to increase code quality labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request qa Technical improvements to increase code quality
Projects
None yet
Development

No branches or pull requests

1 participant