2022-11-03 12:49:39 -04:00
|
|
|
"""
|
|
|
|
Migration script to create postgresql tables
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2022 Concordia CERC group
|
|
|
|
Project Coder Peter Yefi peteryefi@gmail.com
|
|
|
|
"""
|
|
|
|
|
|
|
|
from sqlalchemy import create_engine
|
2022-11-03 15:29:09 -04:00
|
|
|
from persistence.db_config import BaseConfiguration
|
2022-11-03 12:49:39 -04:00
|
|
|
from persistence.models import Building
|
|
|
|
from persistence.models import City
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
config = BaseConfiguration()
|
|
|
|
engine = create_engine(config.conn_string())
|
|
|
|
City.__table__.create(bind=engine, checkfirst=True)
|
|
|
|
Building.__table__.create(bind=engine, checkfirst=True)
|
|
|
|
|