Database migrations #15

Closed
opened 2026-07-02 19:49:36 +02:00 by ahtlon · 1 comment
Owner

Every time i change the db model I have to wipe everything in the db and start over. This is fine in dev since theres no real data but becomes a problem when we continue to develop after deployment.
It seems the reccomended solution for this is Alembic https://lucasgabrielb.com/en/posts/alembic-and-sqlmodel-database-migrations-in-python/

Every time i change the db model I have to wipe everything in the db and start over. This is fine in dev since theres no real data but becomes a problem when we continue to develop after deployment. It seems the reccomended solution for this is Alembic https://lucasgabrielb.com/en/posts/alembic-and-sqlmodel-database-migrations-in-python/
Author
Owner

Should be implemented with 48d272d4d6
To add migration:
after modifying models alembic check
if change alembic revision --autogenerate -m "message"

alembic upgrade head to apply

Should be implemented with 48d272d4d69dd0032714d33ad6f5684e760904b5 To add migration: after modifying models `alembic check` if change `alembic revision --autogenerate -m "message"` `alembic upgrade head` to apply
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: malobeo/gatekeeper#15