|
1 | | -# Generated by Django 4.2.25 on 2025-12-05 09:16 |
| 1 | +# Generated by Django 4.2.25 on 2025-12-11 11:10 |
2 | 2 |
|
3 | 3 | from django.db import migrations, models |
4 | 4 |
|
@@ -35,9 +35,6 @@ class Migration(migrations.Migration): |
35 | 35 | ("patch_text", models.TextField(blank=True, null=True)), |
36 | 36 | ("patch_checksum", models.CharField(blank=True, max_length=128, null=True)), |
37 | 37 | ], |
38 | | - options={ |
39 | | - "unique_together": {("commit_hash", "vcs_url")}, |
40 | | - }, |
41 | 38 | ), |
42 | 39 | migrations.CreateModel( |
43 | 40 | name="Patch", |
@@ -72,9 +69,6 @@ class Migration(migrations.Migration): |
72 | 69 | ), |
73 | 70 | ), |
74 | 71 | ], |
75 | | - options={ |
76 | | - "unique_together": {("patch_checksum", "patch_url")}, |
77 | | - }, |
78 | 72 | ), |
79 | 73 | migrations.RemoveField( |
80 | 74 | model_name="impactedpackage", |
@@ -103,6 +97,23 @@ class Migration(migrations.Migration): |
103 | 97 | migrations.DeleteModel( |
104 | 98 | name="CodeCommit", |
105 | 99 | ), |
| 100 | + migrations.AddConstraint( |
| 101 | + model_name="patch", |
| 102 | + constraint=models.CheckConstraint( |
| 103 | + check=models.Q( |
| 104 | + ("patch_url__isnull", False), ("patch_text__isnull", False), _connector="OR" |
| 105 | + ), |
| 106 | + name="patch_url_or_patch_text", |
| 107 | + ), |
| 108 | + ), |
| 109 | + migrations.AlterUniqueTogether( |
| 110 | + name="patch", |
| 111 | + unique_together={("patch_checksum", "patch_url")}, |
| 112 | + ), |
| 113 | + migrations.AlterUniqueTogether( |
| 114 | + name="packagecommitpatch", |
| 115 | + unique_together={("commit_hash", "vcs_url")}, |
| 116 | + ), |
106 | 117 | migrations.AddField( |
107 | 118 | model_name="advisoryv2", |
108 | 119 | name="patches", |
|
0 commit comments