"""Run from project root: python create_hrms_tables.py"""
from app import create_app, db
from app.hrms_capacity.models import HRMSMapping, HRMSCache, HRMSSyncLog
from sqlalchemy import inspect

app = create_app()
with app.app_context():
    engine = db.engine
    tables = [HRMSMapping.__table__, HRMSCache.__table__, HRMSSyncLog.__table__]
    for table in tables:
        table.create(bind=engine, checkfirst=True)
        print('%s: %s' % (table.name, 'OK' if inspect(engine).has_table(table.name) else 'FAILED'))
