diff --git a/lifecycle/system_migrations/tenant_to_brand.py b/lifecycle/system_migrations/tenant_to_brand.py index 7a9da6f741..a873b2f384 100644 --- a/lifecycle/system_migrations/tenant_to_brand.py +++ b/lifecycle/system_migrations/tenant_to_brand.py @@ -3,7 +3,7 @@ from lifecycle.migrate import BaseMigration SQL_STATEMENT = """ BEGIN TRANSACTION; -ALTER TABLE authentik_tenants_tenant RENAME TO authentik_brands_brand; +ALTER TABLE IF EXISTS authentik_tenants_tenant RENAME TO authentik_brands_brand; UPDATE django_migrations SET app = replace(app, 'authentik_tenants', 'authentik_brands'); UPDATE django_content_type SET app_label = replace(app_label, 'authentik_tenants', 'authentik_brands'); COMMIT;