Finished schema creation

Added Navbar functionality
Added header
This commit is contained in:
Josako
2024-04-25 07:51:18 +02:00
parent 6de87e1509
commit 396de4e079
8 changed files with 166 additions and 66 deletions

View File

@@ -4,6 +4,7 @@ from logging.config import fileConfig
from flask import current_app
from alembic import context
from sqlalchemy import NullPool, engine_from_config, text
from eveai_app.models.user import Tenant
@@ -92,6 +93,7 @@ def run_migrations_online():
)
with connectable.connect() as connection:
print(tenants)
for tenant in tenants:
logger.info(f"Migrating tenant: {tenant}")
# set search path on the connection, which ensures that
@@ -99,7 +101,7 @@ def run_migrations_online():
# in terms of this schema by default
connection.execute(text(f'SET search_path TO "{tenant}"'))
# in SQLAlchemy v2+ the search path change needs to be committed
# connection.commit()
connection.commit()
# make use of non-supported SQLAlchemy attribute to ensure
# the dialect reflects tables in terms of the current tenant name