lifecycle/migrate: fix migration failing if killed during first startup (#14207)
Co-authored-by: Taylor Jones <bigfootjonesy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ea22abc75d
commit
0df4824fd4
@ -3,7 +3,7 @@ from lifecycle.migrate import BaseMigration
|
|||||||
|
|
||||||
SQL_STATEMENT = """
|
SQL_STATEMENT = """
|
||||||
BEGIN TRANSACTION;
|
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_migrations SET app = replace(app, 'authentik_tenants', 'authentik_brands');
|
||||||
UPDATE django_content_type SET app_label = replace(app_label, 'authentik_tenants', 'authentik_brands');
|
UPDATE django_content_type SET app_label = replace(app_label, 'authentik_tenants', 'authentik_brands');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|||||||
Reference in New Issue
Block a user