- License Usage Calculation realised
- View License Usages - Celery Beat container added - First schedule in Celery Beat for calculating usage (hourly) - repopack can now split for different components - Various fixes as consequece of changing file_location / file_name ==> bucket_name / object_name - Celery Routing / Queuing updated
This commit is contained in:
@@ -124,31 +124,34 @@ def run_migrations_online():
|
||||
with connectable.connect() as connection:
|
||||
tenants = get_tenant_ids()
|
||||
for tenant in tenants:
|
||||
logger.info(f"Migrating tenant: {tenant}")
|
||||
# set search path on the connection, which ensures that
|
||||
# PostgreSQL will emit all CREATE / ALTER / DROP statements
|
||||
# in terms of this schema by default
|
||||
connection.execute(text(f'SET search_path TO "{tenant}", public'))
|
||||
# in SQLAlchemy v2+ the search path change needs to be committed
|
||||
connection.commit()
|
||||
try:
|
||||
logger.info(f"Migrating tenant: {tenant}")
|
||||
# set search path on the connection, which ensures that
|
||||
# PostgreSQL will emit all CREATE / ALTER / DROP statements
|
||||
# in terms of this schema by default
|
||||
connection.execute(text(f'SET search_path TO "{tenant}", public'))
|
||||
# in SQLAlchemy v2+ the search path change needs to be committed
|
||||
connection.commit()
|
||||
|
||||
# make use of non-supported SQLAlchemy attribute to ensure
|
||||
# the dialect reflects tables in terms of the current tenant name
|
||||
connection.dialect.default_schema_name = str(tenant)
|
||||
# make use of non-supported SQLAlchemy attribute to ensure
|
||||
# the dialect reflects tables in terms of the current tenant name
|
||||
connection.dialect.default_schema_name = str(tenant)
|
||||
|
||||
context.configure(
|
||||
connection=connection,
|
||||
target_metadata=get_metadata(),
|
||||
# literal_binds=True,
|
||||
include_object=include_object,
|
||||
)
|
||||
context.configure(
|
||||
connection=connection,
|
||||
target_metadata=get_metadata(),
|
||||
# literal_binds=True,
|
||||
include_object=include_object,
|
||||
)
|
||||
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
||||
# for checking migrate or upgrade is running
|
||||
if getattr(config.cmd_opts, "autogenerate", False):
|
||||
break
|
||||
# for checking migrate or upgrade is running
|
||||
if getattr(config.cmd_opts, "autogenerate", False):
|
||||
break
|
||||
except Exception as e:
|
||||
continue
|
||||
|
||||
|
||||
if context.is_offline_mode():
|
||||
|
||||
Reference in New Issue
Block a user