from Controllers.Postgres.database import get_db

from init_app_defaults import create_application_defaults
from init_enums import init_api_enums_build_types
from init_alembic import generate_alembic
from init_occupant_types import create_occupant_types_defaults
from init_services import create_modules_and_services_and_actions
from init_address import create_one_address

set_alembic = True

if __name__ == "__main__":

    with get_db() as db_session:
        if set_alembic:
            generate_alembic(session=db_session)
        init_api_enums_build_types(db_session=db_session)
        create_application_defaults(db_session=db_session)
        create_occupant_types_defaults(db_session=db_session)
        create_modules_and_services_and_actions(db_session=db_session)
        create_one_address(db_session=db_session)
