|
| 1 | +# Generated by Django 6.0.6 on 2026-07-07 04:49 |
| 2 | + |
| 3 | +import django.db.models.deletion |
| 4 | +import dje.models |
| 5 | +import uuid |
| 6 | +from django.db import migrations, models |
| 7 | + |
| 8 | + |
| 9 | +class Migration(migrations.Migration): |
| 10 | + |
| 11 | + dependencies = [ |
| 12 | + ('dje', '0015_alter_dataspaceconfiguration_purldb_api_key_and_more'), |
| 13 | + ('policy', '0003_policyrule'), |
| 14 | + ('product_portfolio', '0017_scancodeproject_import_options'), |
| 15 | + ] |
| 16 | + |
| 17 | + operations = [ |
| 18 | + migrations.CreateModel( |
| 19 | + name='ProductPolicyViolation', |
| 20 | + fields=[ |
| 21 | + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 22 | + ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, verbose_name='UUID')), |
| 23 | + ('violation_count', models.PositiveIntegerField(default=0, help_text='Number of objects currently violating the rule.')), |
| 24 | + ('detected_date', models.DateTimeField(auto_now_add=True, help_text='The date and time when this violation was first detected.')), |
| 25 | + ('last_checked', models.DateTimeField(auto_now=True, help_text='The date and time of the last evaluation.')), |
| 26 | + ('resolved', models.BooleanField(default=False, help_text='Indicates whether this violation has been resolved.')), |
| 27 | + ('resolved_date', models.DateTimeField(blank=True, help_text='The date and time when this violation was resolved.', null=True)), |
| 28 | + ('dataspace', models.ForeignKey(editable=False, help_text='A Dataspace is an independent, exclusive set of DejaCode data, which can be either nexB master reference data or installation-specific data.', on_delete=django.db.models.deletion.PROTECT, to='dje.dataspace')), |
| 29 | + ('policy_rule', models.ForeignKey(help_text='The policy rule that triggered this violation.', on_delete=django.db.models.deletion.CASCADE, related_name='product_violations', to='policy.policyrule')), |
| 30 | + ('product', models.ForeignKey(help_text='The product in the context of which this violation was detected.', on_delete=django.db.models.deletion.CASCADE, related_name='policy_violations', to='product_portfolio.product')), |
| 31 | + ], |
| 32 | + options={ |
| 33 | + 'ordering': ['-detected_date'], |
| 34 | + 'unique_together': {('dataspace', 'uuid'), ('policy_rule', 'product')}, |
| 35 | + }, |
| 36 | + bases=(dje.models.DataspaceForeignKeyValidationMixin, models.Model), |
| 37 | + ), |
| 38 | + ] |
0 commit comments