Quickstart
Copy the Template¶
First we'll create a uv workspace.
Then we'll use uvx to create copy the directory from remote.
This will create two folders: ./migrations/ and ./models/ as well as alembic.ini.
Run the --help command on the migrations module to view available commands:
Create your Models and Migrations¶
Create your first model at ./models/src/models/my_model.py:
from sqlmodel import SQLModel, Field
class MyTable(SQLModel, table=True):
id: int = Field(primary_key=True, default=1)
After creating a model with either SQLModel or SQLAlchemy, make sure to import it at ./models/src/models/__init__.py.
Now, autogenerate a migration:
Your migration will appear in ./migrations/src/migrations/versions/