A simple proof of concept using:
- FastAPI : Python API web framework;
- SQLAlchemy: Python SQL toolkit and ORM;
- Psycopg: Python PostgreSQL database adapter; ( Alembic: Database migration tool for Python SQLAlechemy;
- Uvicorn: ASGI server implementation;
All migration commmands should be run inside the alembic folder.
To create a new migration, do:
alembic revision -m "<describe your migration here>"
To run all migrations, do:
alembic upgrade head
To roll back the last migration, do:
alembic downgrade -1
To laucnch the app locally with reloading on code changes, run:
uvicorn api.main:app --reload