From f7b899bc58f3503bfaaf5a7e3d942c88b47ae71a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kr=C3=B6ger?= Date: Wed, 24 Jul 2024 14:37:27 +0200 Subject: [PATCH] Drop obsolete constraint on server table This constraint ensured that they are no duplicate ip addresses per servertype for objects of ip address type other than loadbalancer. This is now ensured and checked in the clean method of the Server model. This has the advantage that errors are raised as validation exceptions properly displayed in the Servershell and adminapi as errors. The constraints are swallowed as database exception. --- .../migrations/0019_drop_intern_ip_constraint.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 serveradmin/serverdb/migrations/0019_drop_intern_ip_constraint.py diff --git a/serveradmin/serverdb/migrations/0019_drop_intern_ip_constraint.py b/serveradmin/serverdb/migrations/0019_drop_intern_ip_constraint.py new file mode 100644 index 00000000..7a7e987e --- /dev/null +++ b/serveradmin/serverdb/migrations/0019_drop_intern_ip_constraint.py @@ -0,0 +1,14 @@ +# Generated by Django 4.2.11 on 2024-07-24 12:34 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('serverdb', '0018_alter_server_hostname'), + ] + + operations = [ + migrations.RunSQL("ALTER TABLE server DROP CONSTRAINT IF EXISTS server_inter_ip_exclude"), + ]