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 done
ericbuckley opened this issue Nov 21, 2024 · 0 comments · May be fixed by #168
Open
2 tasks done

schema check on startup #143

ericbuckley opened this issue Nov 21, 2024 · 0 comments · May be fixed by #168
Assignees
Labels
feature New feature or request qa Technical improvements to increase code quality

Comments

@ericbuckley
Copy link
Collaborator

ericbuckley commented Nov 21, 2024

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
@cbrinson-rise8 cbrinson-rise8 linked a pull request Jan 8, 2025 that will close this issue
11 tasks
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

Successfully merging a pull request may close this issue.

2 participants