Skip to content

AAI-119 don't automatically update the production DB - use migrations#38

Merged
marius-mather merged 5 commits into
mainfrom
db-migrations
Jul 3, 2025
Merged

AAI-119 don't automatically update the production DB - use migrations#38
marius-mather merged 5 commits into
mainfrom
db-migrations

Conversation

@marius-mather

@marius-mather marius-mather commented Jul 3, 2025

Copy link
Copy Markdown
Collaborator

Description

AAI-119: because we were using SQLModel.create_all() to automatically set up the DB tables, we couldn't run migrations (tables would already exist). Stop automatically creating tables so we can use alembic to manage the DB - requires more manual work, but means we have more control over the DB and won't accidentally alter data with an update

Changes

  • Only run create_all() when we're using a sqlite database, like we do in dev
  • Add the migration for the status approval enum
  • Add documentation for how to manually run the migrations on the production server

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have added unit / integration tests that prove my fix is effective or that my feature works
  • I have run all tests locally and they pass
  • I have updated the documentation (if applicable)

How to Test Manually (if necessary)

N/A

amandazhuyilan
amandazhuyilan previously approved these changes Jul 3, 2025

@amandazhuyilan amandazhuyilan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just nick picking again on docs...

Comment thread README.md
@marius-mather marius-mather merged commit bec7319 into main Jul 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants