29 lines
796 B
Python

"""
Простой скрипт для создания таблиц в БД
"""
import asyncio
from app.database import engine, Base
from app.models import Organization, ReviewTask, Repository, PullRequest, Review, Comment, ReviewEvent
async def create_tables():
"""Создать все таблицы"""
async with engine.begin() as conn:
# Создать все таблицы
await conn.run_sync(Base.metadata.create_all)
print("✅ Таблицы созданы успешно!")
print(" - organizations")
print(" - review_tasks")
print(" - repositories")
print(" - pull_requests")
print(" - reviews")
print(" - comments")
print(" - review_events")
if __name__ == "__main__":
asyncio.run(create_tables())