Initial commit - Migrated to Dev environment
This commit is contained in:
13
backend/app/init_db_direct.py
Executable file
13
backend/app/init_db_direct.py
Executable file
@@ -0,0 +1,13 @@
|
||||
import asyncio
|
||||
from app.db.base import Base
|
||||
from app.db.session import engine
|
||||
from app.models import * # Minden modellt beimportálunk
|
||||
|
||||
async def init_db():
|
||||
async with engine.begin() as conn:
|
||||
# Ez a parancs hozza létre a táblákat a modellek alapján
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
print("✅ Minden tábla sikeresen létrejött a 'data' sémában!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(init_db())
|
||||
Reference in New Issue
Block a user