|
| 1 | +# Generated by Django 4.2.22 on 2025-10-30 23:37 |
| 2 | + |
| 3 | +from django.db import migrations, models |
| 4 | + |
| 5 | + |
| 6 | +class Migration(migrations.Migration): |
| 7 | + |
| 8 | + dependencies = [ |
| 9 | + ("vulnerabilities", "0102_alter_impactedpackage_affecting_vers_and_more"), |
| 10 | + ] |
| 11 | + |
| 12 | + operations = [ |
| 13 | + migrations.CreateModel( |
| 14 | + name="CodeCommit", |
| 15 | + fields=[ |
| 16 | + ( |
| 17 | + "id", |
| 18 | + models.AutoField( |
| 19 | + auto_created=True, primary_key=True, serialize=False, verbose_name="ID" |
| 20 | + ), |
| 21 | + ), |
| 22 | + ( |
| 23 | + "commit_hash", |
| 24 | + models.CharField( |
| 25 | + help_text="Unique commit identifier (e.g., SHA).", max_length=64 |
| 26 | + ), |
| 27 | + ), |
| 28 | + ( |
| 29 | + "vcs_url", |
| 30 | + models.URLField(help_text="URL of the repository containing the commit."), |
| 31 | + ), |
| 32 | + ( |
| 33 | + "commit_rank", |
| 34 | + models.IntegerField( |
| 35 | + default=0, |
| 36 | + help_text="Rank of the commit to support ordering by commit. Rank zero means the rank has not been defined yet", |
| 37 | + ), |
| 38 | + ), |
| 39 | + ( |
| 40 | + "commit_author", |
| 41 | + models.CharField( |
| 42 | + blank=True, help_text="Author of the commit.", max_length=100, null=True |
| 43 | + ), |
| 44 | + ), |
| 45 | + ( |
| 46 | + "commit_date", |
| 47 | + models.DateTimeField( |
| 48 | + blank=True, |
| 49 | + help_text="Timestamp indicating when this commit was created.", |
| 50 | + null=True, |
| 51 | + ), |
| 52 | + ), |
| 53 | + ( |
| 54 | + "commit_message", |
| 55 | + models.TextField( |
| 56 | + blank=True, help_text="Commit message or description.", null=True |
| 57 | + ), |
| 58 | + ), |
| 59 | + ], |
| 60 | + options={ |
| 61 | + "unique_together": {("commit_hash", "vcs_url")}, |
| 62 | + }, |
| 63 | + ), |
| 64 | + migrations.AddField( |
| 65 | + model_name="impactedpackage", |
| 66 | + name="affecting_commits", |
| 67 | + field=models.ManyToManyField( |
| 68 | + help_text="Commits introducing this impact.", |
| 69 | + related_name="affecting_commits_in_impacts", |
| 70 | + to="vulnerabilities.codecommit", |
| 71 | + ), |
| 72 | + ), |
| 73 | + migrations.AddField( |
| 74 | + model_name="impactedpackage", |
| 75 | + name="fixed_by_commits", |
| 76 | + field=models.ManyToManyField( |
| 77 | + help_text="Commits fixing this impact.", |
| 78 | + related_name="fixing_commits_in_impacts", |
| 79 | + to="vulnerabilities.codecommit", |
| 80 | + ), |
| 81 | + ), |
| 82 | + ] |
0 commit comments