From 940492a5e1a70dd1991ab61ec0a99c59d64ac86a Mon Sep 17 00:00:00 2001 From: Jens L Date: Thu, 26 Oct 2023 20:05:33 +0200 Subject: [PATCH] lifecycle: fix otp merge migration (#7315) Signed-off-by: Jens Langhammer --- lifecycle/system_migrations/otp_merge.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lifecycle/system_migrations/otp_merge.py b/lifecycle/system_migrations/otp_merge.py index 013818606..6e6a1970c 100644 --- a/lifecycle/system_migrations/otp_merge.py +++ b/lifecycle/system_migrations/otp_merge.py @@ -2,6 +2,7 @@ from lifecycle.migrate import BaseMigration SQL_STATEMENT = """ +BEGIN TRANSACTION; DELETE FROM django_migrations WHERE app = 'otp_static'; DELETE FROM django_migrations WHERE app = 'otp_totp'; -- Rename tables (static) @@ -12,6 +13,7 @@ ALTER SEQUENCE otp_static_staticdevice_id_seq RENAME TO authentik_stages_authent -- Rename tables (totp) ALTER TABLE otp_totp_totpdevice RENAME TO authentik_stages_authenticator_totp_totpdevice; ALTER SEQUENCE otp_totp_totpdevice_id_seq RENAME TO authentik_stages_authenticator_totp_totpdevice_id_seq; +COMMIT; """