Перенести рабочую базу lab4 в skeleton лабораторной 5.

Исходники, миграции, Dockerfile и стенд lab4 нужны как основа асинхронной обработки вложений.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-09 00:48:22 +03:00
co-authored by Cursor
parent 276dbdad8a
commit 9046d5206d
40 changed files with 4136 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
"""One-shot schema apply. API replicas do not run this on startup."""
import asyncio
import logging
import sys
from app import config, db
async def _main() -> None:
if not config.DATABASE_URL:
raise SystemExit("DATABASE_URL is not set")
await db.connect()
try:
await db.apply_migrations()
finally:
await db.close()
def main() -> None:
logging.basicConfig(
level=getattr(logging, config.LOG_LEVEL.upper(), logging.INFO),
format="%(asctime)s %(levelname)s %(name)s %(message)s",
stream=sys.stdout,
)
asyncio.run(_main())
if __name__ == "__main__":
main()