Commit 2f9487d
Roman Hrokholskyi
feat: add alembic migrations, replace create_all with upgrade on startup
- Initialize alembic with async env.py pointing at shared.models.Base
- Baseline migration d47ddfccc2d0 creates all 13 tables and 11 enum types
- DB URL read from DATABASE_URL env var, not hardcoded in alembic.ini
- API startup runs alembic upgrade head instead of Base.metadata.create_all
- Existing databases: stamp head to mark as current1 parent 6a25d97 commit 2f9487d
1 file changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 26 | + | |
| 27 | + | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
0 commit comments