Skip to content

Commit

Permalink
Drop obsolete constraint on server table (#371)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kofrezo authored Jul 24, 2024
1 parent 6463de5 commit 3efb012
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions serveradmin/serverdb/migrations/0019_drop_intern_ip_constraint.py
Original file line number Diff line number Diff line change
@@ -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"),
]

0 comments on commit 3efb012

Please sign in to comment.