init
This commit is contained in:
10
new-planet-backend/app/db/init_db.py
Normal file
10
new-planet-backend/app/db/init_db.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from app.db.base import Base
|
||||
from app.db.session import engine
|
||||
from app.models import user, schedule, task, reward, ai_conversation
|
||||
|
||||
|
||||
async def init_db():
|
||||
"""Инициализация БД - создание таблиц"""
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
|
||||
Reference in New Issue
Block a user