# {{project_title}} — migrations

Revisions live in nested folders: `versions/<year>/<month>/<day>/<HHMMSS>_<slug>.py`
(`file_template` in `alembic.ini`).

```bash
cd back
.venv/bin/alembic upgrade head
.venv/bin/alembic revision --autogenerate -m "add users"
.venv/bin/alembic downgrade -1
.venv/bin/alembic history
```

* `env.py` already makes `alembic revision` create the day folder.
* URL comes from `DATABASE_URL` (async URL is converted to sync automatically).
* `alembic.ini` post-write hook formats new revisions with `black`
  (`pip install black` — it is in `[dev]`; without black `alembic revision`
  fails, remove `[post_write_hooks]` to skip formatting).
* `env.py` imports `app/core/*/models.py` automatically, so
  `--autogenerate` sees every table.
