-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Squash migrations / fix migrations for nautobot 2.0 #113
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("nautobot_device_onboarding", "0003_onboardingtask_label"), | ||
("nautobot_device_onboarding", "0007_alter_onboardingtask_ip_address"), | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly add a comment here explaining that this is needed to bring the 01->02->03 and the 01->04->05->06->07 branches of the migration tree back together? |
||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="onboardingtask", | ||
options={ | ||
"ordering": ("label",), | ||
}, | ||
), | ||
migrations.AlterUniqueTogether( | ||
name="onboardingtask", | ||
unique_together={("label", "ip_address")}, | ||
), | ||
] |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is numbering this one as 0101 confusing? Can we number it as something like 0001_0004_0005_0006 instead and would that be clearer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd be concerned about having another |
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", | ||
), | ||
), | ||
], | ||
), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind adding a docstring or comment explaining this and the similar logic in the previous file for future reference?