-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make target servertype optional for relation attributes (#335)
- Loading branch information
Showing
2 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
serveradmin/serverdb/migrations/0016_optional_servertype_for_relation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 3.2.23 on 2023-11-03 08:04 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('serverdb', '0015_attribute_history_field'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
"ALTER TABLE attribute DROP CONSTRAINT IF EXISTS attribute_target_servertype_id_check" | ||
), | ||
# This is the same as before but without a check for type relation. | ||
migrations.RunSQL( | ||
"ALTER TABLE attribute ADD CONSTRAINT attribute_target_servertype_id_check " | ||
"CHECK((type IN ('domain', 'supernet', 'relation')) = (target_servertype_id IS NOT NULL OR type = 'relation'))" | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters