Skip to content

Commit

Permalink
Closes #13647: Squash all migrations prior to v3.7 (#14853)
Browse files Browse the repository at this point in the history
* Regenerate pre-v3.7 migrations

* Annotate replaced migrations

* Rename dependencies; remove FeatureQuery references

* Add missed replacement
  • Loading branch information
jeremystretch authored Jan 19, 2024
1 parent ef5e10d commit 874685f
Show file tree
Hide file tree
Showing 190 changed files with 4,355 additions and 9,145 deletions.
2 changes: 0 additions & 2 deletions netbox/account/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Generated by Django 4.1.10 on 2023-07-30 17:49

from django.db import migrations


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import ipam.fields
from utilities.json import CustomFieldJSONEncoder
from django.db import migrations, models
import django.db.models.deletion
import utilities.json


class Migration(migrations.Migration):
Expand All @@ -11,36 +10,36 @@ class Migration(migrations.Migration):
dependencies = [
]

replaces = [
('circuits', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Circuit',
fields=[
('created', models.DateField(auto_now_add=True, null=True)),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
('created', models.DateTimeField(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=CustomFieldJSONEncoder)),
('id', models.BigAutoField(primary_key=True, serialize=False)),
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
('description', models.CharField(blank=True, max_length=200)),
('comments', models.TextField(blank=True)),
('cid', models.CharField(max_length=100)),
('status', models.CharField(default='active', max_length=50)),
('install_date', models.DateField(blank=True, null=True)),
('termination_date', models.DateField(blank=True, null=True)),
('commit_rate', models.PositiveIntegerField(blank=True, null=True)),
('description', models.CharField(blank=True, max_length=200)),
('comments', models.TextField(blank=True)),
],
options={
'ordering': ['provider', 'cid'],
'verbose_name': 'circuit',
'verbose_name_plural': 'circuits',
'ordering': ['provider', 'provider_account', 'cid'],
},
),
migrations.CreateModel(
name='CircuitTermination',
fields=[
('created', models.DateField(auto_now_add=True, null=True)),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
('created', models.DateTimeField(auto_now_add=True, null=True)),
('last_updated', models.DateTimeField(auto_now=True, null=True)),
('id', models.BigAutoField(primary_key=True, serialize=False)),
('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
('cable_end', models.CharField(blank=True, max_length=1)),
('mark_connected', models.BooleanField(default=False)),
('term_side', models.CharField(max_length=1)),
('port_speed', models.PositiveIntegerField(blank=True, null=True)),
Expand All @@ -50,57 +49,80 @@ class Migration(migrations.Migration):
('description', models.CharField(blank=True, max_length=200)),
],
options={
'verbose_name': 'circuit termination',
'verbose_name_plural': 'circuit terminations',
'ordering': ['circuit', 'term_side'],
},
),
migrations.CreateModel(
name='CircuitType',
fields=[
('created', models.DateField(auto_now_add=True, null=True)),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
('created', models.DateTimeField(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=CustomFieldJSONEncoder)),
('id', models.BigAutoField(primary_key=True, serialize=False)),
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
('name', models.CharField(max_length=100, unique=True)),
('slug', models.SlugField(max_length=100, unique=True)),
('description', models.CharField(blank=True, max_length=200)),
],
options={
'verbose_name': 'circuit type',
'verbose_name_plural': 'circuit types',
'ordering': ('name',),
},
),
migrations.CreateModel(
name='Provider',
fields=[
('created', models.DateField(auto_now_add=True, null=True)),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
('created', models.DateTimeField(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=CustomFieldJSONEncoder)),
('id', models.BigAutoField(primary_key=True, serialize=False)),
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
('description', models.CharField(blank=True, max_length=200)),
('comments', models.TextField(blank=True)),
('name', models.CharField(max_length=100, unique=True)),
('slug', models.SlugField(max_length=100, unique=True)),
('asn', ipam.fields.ASNField(blank=True, null=True)),
('account', models.CharField(blank=True, max_length=30)),
('portal_url', models.URLField(blank=True)),
('noc_contact', models.TextField(blank=True)),
('admin_contact', models.TextField(blank=True)),
('comments', models.TextField(blank=True)),
],
options={
'verbose_name': 'provider',
'verbose_name_plural': 'providers',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='ProviderAccount',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
('created', models.DateTimeField(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=utilities.json.CustomFieldJSONEncoder)),
('description', models.CharField(blank=True, max_length=200)),
('comments', models.TextField(blank=True)),
('account', models.CharField(max_length=100)),
('name', models.CharField(blank=True, max_length=100)),
],
options={
'verbose_name': 'provider account',
'verbose_name_plural': 'provider accounts',
'ordering': ('provider', 'account'),
},
),
migrations.CreateModel(
name='ProviderNetwork',
fields=[
('created', models.DateField(auto_now_add=True, null=True)),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
('created', models.DateTimeField(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=CustomFieldJSONEncoder)),
('id', models.BigAutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
('description', models.CharField(blank=True, max_length=200)),
('comments', models.TextField(blank=True)),
('name', models.CharField(max_length=100)),
('service_id', models.CharField(blank=True, max_length=100)),
('provider', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='networks', to='circuits.provider')),
],
options={
'verbose_name': 'provider network',
'verbose_name_plural': 'provider networks',
'ordering': ('provider', 'name'),
},
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
# Generated by Django 3.2.8 on 2021-10-21 14:50

from django.db import migrations
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers


class Migration(migrations.Migration):

initial = True

dependencies = [
('extras', '0062_clear_secrets_changelog'),
('ipam', '0050_iprange'),
('extras', '0001_initial'),
('circuits', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='rir',
model_name='providernetwork',
name='tags',
field=taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag'),
),
migrations.AddField(
model_name='role',
name='tags',
field=taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag'),
model_name='provideraccount',
name='provider',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='accounts', to='circuits.provider'),
),
migrations.AddField(
model_name='vlangroup',
model_name='provideraccount',
name='tags',
field=taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag'),
),
Expand Down
20 changes: 0 additions & 20 deletions netbox/circuits/migrations/0003_extend_tag_support.py

This file was deleted.

73 changes: 73 additions & 0 deletions netbox/circuits/migrations/0003_squashed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers


class Migration(migrations.Migration):

initial = True

dependencies = [
('extras', '0001_initial'),
('ipam', '0001_initial'),
('dcim', '0001_initial'),
('circuits', '0002_squashed'),
]

operations = [
migrations.AddField(
model_name='provider',
name='asns',
field=models.ManyToManyField(blank=True, related_name='providers', to='ipam.asn'),
),
migrations.AddField(
model_name='provider',
name='tags',
field=taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag'),
),
migrations.AddField(
model_name='circuittype',
name='tags',
field=taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag'),
),
migrations.AddField(
model_name='circuittermination',
name='cable',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='dcim.cable'),
),
migrations.AddField(
model_name='circuittermination',
name='circuit',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='terminations', to='circuits.circuit'),
),
migrations.AddField(
model_name='circuittermination',
name='provider_network',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='circuit_terminations', to='circuits.providernetwork'),
),
migrations.AddField(
model_name='circuittermination',
name='site',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='circuit_terminations', to='dcim.site'),
),
migrations.AddField(
model_name='circuittermination',
name='tags',
field=taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag'),
),
migrations.AddField(
model_name='circuit',
name='provider',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='circuits', to='circuits.provider'),
),
migrations.AddField(
model_name='circuit',
name='provider_account',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='circuits', to='circuits.provideraccount'),
),
migrations.AddField(
model_name='circuit',
name='tags',
field=taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag'),
),
]
21 changes: 0 additions & 21 deletions netbox/circuits/migrations/0004_rename_cable_peer.py

This file was deleted.

Loading

0 comments on commit 874685f

Please sign in to comment.