-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from nautobot/u/gas-squash-migrations
Squash migrations / fix migrations for Nautobot 2.0
- Loading branch information
Showing
7 changed files
with
155 additions
and
13 deletions.
There are no files selected for viewing
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
97 changes: 97 additions & 0 deletions
97
nautobot_device_onboarding/migrations/0001_squash__0001_0004_0005_0006.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,97 @@ | ||
# Generated by Django 3.2.21 on 2023-10-13 16:17 | ||
|
||
import uuid | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
import nautobot_device_onboarding.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
replaces = [ | ||
("nautobot_device_onboarding", "0001_initial"), | ||
("nautobot_device_onboarding", "0004_migrate_to_extras_role_part_1"), | ||
("nautobot_device_onboarding", "0004_migrate_to_extras_role_part_2"), | ||
("nautobot_device_onboarding", "0004_migrate_to_extras_role_part_3"), | ||
("nautobot_device_onboarding", "0005_migrate_site_to_location_part_1"), | ||
("nautobot_device_onboarding", "0005_migrate_site_to_location_part_2"), | ||
("nautobot_device_onboarding", "0005_migrate_site_to_location_part_3"), | ||
("nautobot_device_onboarding", "0006_update_model_fields_part_1"), | ||
("nautobot_device_onboarding", "0006_update_model_fields_part_2"), | ||
("nautobot_device_onboarding", "0006_update_model_fields_part_3"), | ||
] | ||
|
||
dependencies = [ | ||
("dcim", "0049_remove_slugs_and_change_device_primary_ip_fields"), | ||
("extras", "0098_rename_data_jobresult_result"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="OnboardingDevice", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True | ||
), | ||
), | ||
("enabled", models.BooleanField(default=True)), | ||
("device", models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to="dcim.device")), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="OnboardingTask", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True | ||
), | ||
), | ||
("created", models.DateTimeField(auto_now_add=True, null=True)), | ||
("last_updated", models.DateTimeField(auto_now=True, null=True)), | ||
("ip_address", models.CharField(max_length=255)), | ||
("device_type", models.CharField(blank=True, default="", max_length=255)), | ||
("status", models.CharField(blank=True, default="", max_length=255)), | ||
("failed_reason", models.CharField(blank=True, default="", max_length=255)), | ||
("message", models.CharField(blank=True, max_length=511)), | ||
("port", models.PositiveSmallIntegerField(default=22)), | ||
("timeout", models.PositiveSmallIntegerField(default=30)), | ||
( | ||
"created_device", | ||
models.ForeignKey( | ||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="dcim.device" | ||
), | ||
), | ||
( | ||
"location", | ||
models.ForeignKey( | ||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="dcim.location" | ||
), | ||
), | ||
( | ||
"platform", | ||
models.ForeignKey( | ||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="dcim.platform" | ||
), | ||
), | ||
( | ||
"role", | ||
nautobot_device_onboarding.models.DeviceLimitedRoleField( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="onboarding_tasks", | ||
to="extras.role", | ||
), | ||
), | ||
], | ||
), | ||
] |
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
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
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
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
23 changes: 23 additions & 0 deletions
23
nautobot_device_onboarding/migrations/0008_alter_onboardingtask_options.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,23 @@ | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("nautobot_device_onboarding", "0003_onboardingtask_label"), | ||
# This migration does not actually depend on the below migration but it is added here to | ||
# prevent Django from failing to migrate due to multiple leaf nodes in the migration graph | ||
("nautobot_device_onboarding", "0007_alter_onboardingtask_ip_address"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="onboardingtask", | ||
options={ | ||
"ordering": ("label",), | ||
}, | ||
), | ||
migrations.AlterUniqueTogether( | ||
name="onboardingtask", | ||
unique_together={("label", "ip_address")}, | ||
), | ||
] |