alembic-removed

This commit is contained in:
2025-08-28 19:42:03 +03:00
parent 6a3862ad61
commit 4f63da037d
11 changed files with 123 additions and 302 deletions

16
main.py
View File

@@ -210,22 +210,6 @@ async def lifespan(app: Starlette):
"""
try:
print("[lifespan] Starting application initialization")
# Запускаем миграции Alembic перед созданием таблиц
print("[lifespan] Running database migrations...")
try:
import subprocess
result = subprocess.run(
["alembic", "upgrade", "head"], check=False, capture_output=True, text=True, cwd="/app"
)
if result.returncode == 0:
print("[lifespan] Database migrations completed successfully")
else:
print(f"[lifespan] Warning: migrations failed: {result.stderr}")
except Exception as e:
print(f"[lifespan] Warning: could not run migrations: {e}")
create_all_tables()
# Инициализируем RBAC систему с dependency injection