docs(backend): update db.py docstring to reflect migrations-first order

This commit is contained in:
Tyler
2026-06-19 21:36:26 -06:00
parent 5be6299b3a
commit 0fdb760bc1
+4 -3
View File
@@ -2,9 +2,10 @@
`init_db()` is called from `cyclone.__main__:serve` before uvicorn starts.
It reads `CYCLONE_DB_URL` (default `sqlite:///~/.local/share/cyclone/cyclone.db`),
creates the engine, runs `Base.metadata.create_all`, then runs the migration
runner. Calling `init_db()` is idempotent — calling it twice on the same URL
re-uses the same engine.
creates the engine, runs the migration runner, then runs `Base.metadata.create_all`
as a safety net (which is a no-op when the migration is current). Calling
`init_db()` is idempotent — calling it twice on the same URL re-uses the
same engine.
"""
from __future__ import annotations