energy_system_modelling_wor.../persistence/db_setup.py

11 lines
404 B
Python
Raw Normal View History

2022-12-07 19:06:17 -05:00
from persistence.models import City
from persistence import BaseRepo
from persistence.models import HeatPumpSimulation
class DBSetup:
def __init__(self, db_name, app_env, dotenv_path):
repo = BaseRepo(db_name=db_name, app_env=app_env, dotenv_path=dotenv_path)
City.__table__.create(bind=repo.engine, checkfirst=True)
HeatPumpSimulation.__table__.create(bind=repo.engine, checkfirst=True)