add init new files
This commit is contained in:
12
app/db/init_db.py
Normal file
12
app/db/init_db.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from sqlalchemy import text
|
||||
|
||||
from app.db.base import Base
|
||||
from app.db.engine import engine
|
||||
|
||||
|
||||
def init_db() -> None:
|
||||
with engine.begin() as conn:
|
||||
conn.execute(text("CREATE SCHEMA IF NOT EXISTS fastapi"))
|
||||
conn.execute(text("CREATE SCHEMA IF NOT EXISTS operationbi"))
|
||||
|
||||
Base.metadata.create_all(bind=conn)
|
||||
Reference in New Issue
Block a user