docs(backend): update db.py docstring to reflect migrations-first order
This commit is contained in:
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
`init_db()` is called from `cyclone.__main__:serve` before uvicorn starts.
|
`init_db()` is called from `cyclone.__main__:serve` before uvicorn starts.
|
||||||
It reads `CYCLONE_DB_URL` (default `sqlite:///~/.local/share/cyclone/cyclone.db`),
|
It reads `CYCLONE_DB_URL` (default `sqlite:///~/.local/share/cyclone/cyclone.db`),
|
||||||
creates the engine, runs `Base.metadata.create_all`, then runs the migration
|
creates the engine, runs the migration runner, then runs `Base.metadata.create_all`
|
||||||
runner. Calling `init_db()` is idempotent — calling it twice on the same URL
|
as a safety net (which is a no-op when the migration is current). Calling
|
||||||
re-uses the same engine.
|
`init_db()` is idempotent — calling it twice on the same URL re-uses the
|
||||||
|
same engine.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|||||||
Reference in New Issue
Block a user