feat(migrations): T11 setup Alembic and initial schema migration

- Initialize Alembic with alembic init alembic
- Configure alembic.ini to use DATABASE_URL from environment
- Configure alembic/env.py to import Base and models metadata
- Generate initial migration: c92fc544a483_initial_schema
- Migration creates all 4 tables: users, api_keys, api_tokens, usage_stats
- Migration includes all indexes, constraints, and foreign keys
- Test upgrade/downgrade cycle works correctly

Alembic commands:
- alembic upgrade head
- alembic downgrade -1
- alembic revision --autogenerate -m 'message'

Tests: 13 migration tests pass
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-07 11:14:45 +02:00
parent ea198e8b0d
commit abe9fc166b
6 changed files with 603 additions and 2 deletions

1
alembic/README Normal file
View File

@@ -0,0 +1 @@
Generic single-database configuration.