diff --git a/nautobot_golden_config/migrations/0025_remediation_settings.py b/nautobot_golden_config/migrations/0025_remediation_settings.py new file mode 100644 index 00000000..b2e6b12c --- /dev/null +++ b/nautobot_golden_config/migrations/0025_remediation_settings.py @@ -0,0 +1,66 @@ +# Generated by Django 3.2.16 on 2023-07-07 09:21 + +import uuid + +import django.core.serializers.json +import django.db.models.deletion +import nautobot.extras.models.mixins +import taggit.managers +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("dcim", "0019_device_redundancy_group_data_migration"), + ("extras", "0053_relationship_required_on"), + ("nautobot_golden_config", "0024_convert_custom_compliance_rules"), + ] + + operations = [ + migrations.AddField( + model_name="configcompliance", + name="remediation", + field=models.JSONField(blank=True, null=True), + ), + migrations.AddField( + model_name="compliancerule", + name="config_remediation", + field=models.BooleanField(default=False), + ), + migrations.CreateModel( + name="RemediationSetting", + fields=[ + ( + "id", + models.UUIDField( + default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True + ), + ), + ("created", models.DateField(auto_now_add=True, null=True)), + ("last_updated", models.DateTimeField(auto_now=True, null=True)), + ( + "_custom_field_data", + models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder), + ), + ("remediation_type", models.CharField(default="hierconfig", max_length=50)), + ("remediation_options", models.JSONField(blank=True, default=dict)), + ( + "platform", + models.OneToOneField( + on_delete=django.db.models.deletion.CASCADE, + related_name="remediation_settings", + to="dcim.platform", + ), + ), + ("tags", taggit.managers.TaggableManager(through="extras.TaggedItem", to="extras.Tag")), + ], + options={ + "abstract": False, + }, + bases=( + models.Model, + nautobot.extras.models.mixins.DynamicGroupMixin, + nautobot.extras.models.mixins.NotesMixin, + ), + ), + ] diff --git a/nautobot_golden_config/migrations/0025_auto_20230912_0352.py b/nautobot_golden_config/migrations/0026_configplan.py similarity index 57% rename from nautobot_golden_config/migrations/0025_auto_20230912_0352.py rename to nautobot_golden_config/migrations/0026_configplan.py index 16d708fe..5ca9c529 100644 --- a/nautobot_golden_config/migrations/0025_auto_20230912_0352.py +++ b/nautobot_golden_config/migrations/0026_configplan.py @@ -1,68 +1,23 @@ -# Generated by Django 3.2.20 on 2023-09-12 03:52 +# Generated by Django 3.2.20 on 2023-09-01 14:51 + +import uuid import django.core.serializers.json -from django.db import migrations, models import django.db.models.deletion import nautobot.extras.models.mixins import nautobot.extras.models.statuses import taggit.managers -import uuid +from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("dcim", "0023_interface_redundancy_group_data_migration"), ("extras", "0058_jobresult_add_time_status_idxs"), - ("nautobot_golden_config", "0024_convert_custom_compliance_rules"), + ("nautobot_golden_config", "0025_remediation_settings"), ] operations = [ - migrations.AddField( - model_name="compliancerule", - name="config_remediation", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="configcompliance", - name="remediation", - field=models.JSONField(blank=True, null=True), - ), - migrations.CreateModel( - name="RemediationSetting", - fields=[ - ( - "id", - models.UUIDField( - default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True - ), - ), - ("created", models.DateField(auto_now_add=True, null=True)), - ("last_updated", models.DateTimeField(auto_now=True, null=True)), - ( - "_custom_field_data", - models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder), - ), - ("remediation_type", models.CharField(default="hierconfig", max_length=50)), - ("remediation_options", models.JSONField(blank=True, default=dict)), - ( - "platform", - models.OneToOneField( - on_delete=django.db.models.deletion.CASCADE, - related_name="remediation_settings", - to="dcim.platform", - ), - ), - ("tags", taggit.managers.TaggableManager(through="extras.TaggedItem", to="extras.Tag")), - ], - options={ - "ordering": ("platform", "remediation_type"), - }, - bases=( - models.Model, - nautobot.extras.models.mixins.DynamicGroupMixin, - nautobot.extras.models.mixins.NotesMixin, - ), - ), migrations.CreateModel( name="ConfigPlan", fields=[ @@ -80,7 +35,7 @@ class Migration(migrations.Migration): ), ("plan_type", models.CharField(max_length=20)), ("config_set", models.TextField()), - ("change_control_id", models.CharField(blank=True, max_length=50)), + ("change_control_id", models.CharField(blank=True, max_length=50, null=True)), ("change_control_url", models.URLField(blank=True)), ( "device", diff --git a/nautobot_golden_config/migrations/0027_auto_20230912_1731.py b/nautobot_golden_config/migrations/0027_auto_20230912_1731.py new file mode 100644 index 00000000..91e9faa8 --- /dev/null +++ b/nautobot_golden_config/migrations/0027_auto_20230912_1731.py @@ -0,0 +1,22 @@ +# Generated by Django 3.2.20 on 2023-09-12 17:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("nautobot_golden_config", "0026_configplan"), + ] + + operations = [ + migrations.AlterModelOptions( + name="remediationsetting", + options={"ordering": ("platform", "remediation_type")}, + ), + migrations.AlterField( + model_name="configplan", + name="change_control_id", + field=models.CharField(blank=True, default="", max_length=50), + preserve_default=False, + ), + ]