- Temporarily remove PartnerRagRetriever model (as it is not used yet)
- Ensure errors are being logged when migrating tenants - Ensure migrations directory is copied into eveai_app
This commit is contained in:
@@ -70,10 +70,12 @@ target_db = current_app.extensions['migrate'].db
|
||||
|
||||
def get_public_table_names():
|
||||
# TODO: This function should include the necessary functionality to automatically retrieve table names
|
||||
return ['role', 'roles_users', 'tenant', 'user', 'tenant_domain','license_tier', 'license', 'license_usage',
|
||||
'business_event_log', 'tenant_project', 'partner', 'partner_service', 'invoice', 'license_period',
|
||||
'license_change_log', 'partner_service_license_tier', 'payment', 'partner_tenant', 'tenant_make',
|
||||
'specialist_magic_link_tenant', 'translation_cache']
|
||||
return ['tenant', 'role', 'roles_users', 'user', 'tenant_domain', 'tenant_project', 'tenant_make', 'partner',
|
||||
'partner_service', 'partner_tenant', 'tenant_consent', 'consent_version', 'specialist_magic_link_tenant',
|
||||
'translation_cache',
|
||||
'business_event_log', 'license', 'license_tier', 'partner_service_license_tier', 'license_period',
|
||||
'license_usage', 'payment', 'invoice', 'license_change_log',
|
||||
]
|
||||
|
||||
PUBLIC_TABLES = get_public_table_names()
|
||||
logger.info(f"Public tables: {PUBLIC_TABLES}")
|
||||
@@ -147,7 +149,7 @@ def run_migrations_online():
|
||||
for tenant in tenants:
|
||||
try:
|
||||
os.environ['TENANT_ID'] = str(tenant)
|
||||
logger.info(f"Migrating tenant: {tenant}")
|
||||
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
|
||||
@@ -169,11 +171,13 @@ def run_migrations_online():
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
||||
logger.info(f"✅ Migration successfully completed for tenant: {tenant}")
|
||||
|
||||
# for checking migrate or upgrade is running
|
||||
if getattr(config.cmd_opts, "autogenerate", False):
|
||||
break
|
||||
except Exception as e:
|
||||
continue
|
||||
logger.error(f"🚨 An error occurred during migration: \n{e}")
|
||||
|
||||
|
||||
if context.is_offline_mode():
|
||||
|
||||
Reference in New Issue
Block a user