From a3615df165859c370fa8efd0306bdf37b0ef84d7 Mon Sep 17 00:00:00 2001 From: itqop Date: Tue, 30 Dec 2025 23:31:18 +0300 Subject: [PATCH] yes --- backend/src/app/main.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/backend/src/app/main.py b/backend/src/app/main.py index 7545fdc..6b9e8d6 100644 --- a/backend/src/app/main.py +++ b/backend/src/app/main.py @@ -17,24 +17,6 @@ async def lifespan(app: FastAPI): """Application lifespan handler.""" # Startup await init_db() - - # TEMPORARY: Clean up old deleted assets (remove this after first run) - from app.infra.database import AsyncSessionLocal - from sqlalchemy import text - - async with AsyncSessionLocal() as session: - # Check how many deleted assets exist - result = await session.execute(text("SELECT COUNT(*) FROM assets WHERE status = 'deleted'")) - count_before = result.scalar() - print(f"[MIGRATION] Found {count_before} assets with status='deleted'") - - # Delete them - result = await session.execute(text("DELETE FROM assets WHERE status = 'deleted'")) - await session.commit() - print(f"[MIGRATION] Deleted {result.rowcount} assets with status='deleted'") - print("[MIGRATION] Migration complete - you can now remove this code from main.py") - # END TEMPORARY - yield # Shutdown pass