From a4f25a44f81f3eb5618cd174fc539f80b1aaa798 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Fri, 12 Jul 2024 13:59:43 +0700 Subject: [PATCH] 16625 don't alter SQL table if sequence already exists --- netbox/extras/migrations/0111_rename_content_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/extras/migrations/0111_rename_content_types.py b/netbox/extras/migrations/0111_rename_content_types.py index acd6aef0f..c723a58b1 100644 --- a/netbox/extras/migrations/0111_rename_content_types.py +++ b/netbox/extras/migrations/0111_rename_content_types.py @@ -31,7 +31,7 @@ class Migration(migrations.Migration): ), # Pre-v2.10 sequence name (see #15605) migrations.RunSQL( - "ALTER TABLE IF EXISTS extras_customfield_obj_type_id_seq RENAME TO extras_customfield_object_types_id_seq" + "ALTER TABLE IF NOT EXISTS extras_customfield_object_types_id_seq AND EXISTS extras_customfield_obj_type_id_seq RENAME TO extras_customfield_object_types_id_seq" ), # Custom links