Skip to content

2022¤

How to add Alembic migrations to an existing FastAPI + Ormar project

I had trouble adding an ON DELETE CASCADE constraint to foreign keys after they were already created, so here's a small post explaning how I did it. This specific constraint, ON DELETE CASCADE, is not relevant here. This post will help you for any kind of change you want to apply on database already used in production.

add alembic migrations to existing fastapi ormar project