mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 19:36:26 -06:00
Reformat migration files to fix line length violations
This commit is contained in:
parent
003855ff8b
commit
b25c744501
@ -5,11 +5,9 @@ import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
dependencies = []
|
||||
|
||||
replaces = [
|
||||
('circuits', '0001_initial'),
|
||||
@ -98,7 +96,12 @@ class Migration(migrations.Migration):
|
||||
('name', models.CharField(max_length=100)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('comments', models.TextField(blank=True)),
|
||||
('provider', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='networks', to='circuits.provider')),
|
||||
(
|
||||
'provider',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='networks', to='circuits.provider'
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('provider', 'name'),
|
||||
|
@ -4,7 +4,6 @@ import taggit.managers
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0001_initial'),
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
@ -58,32 +57,56 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='circuittermination',
|
||||
name='_cable_peer_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
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'),
|
||||
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'),
|
||||
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'),
|
||||
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'),
|
||||
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='circuit',
|
||||
name='provider',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='circuits', to='circuits.provider'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='circuits', to='circuits.provider'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='circuit',
|
||||
@ -93,26 +116,50 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='circuit',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='circuits', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='circuits',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='circuit',
|
||||
name='termination_a',
|
||||
field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='circuits.circuittermination'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
editable=False,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='circuits.circuittermination',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='circuit',
|
||||
name='termination_z',
|
||||
field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='circuits.circuittermination'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
editable=False,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='circuits.circuittermination',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='circuit',
|
||||
name='type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='circuits', to='circuits.circuittype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='circuits', to='circuits.circuittype'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='providernetwork',
|
||||
constraint=models.UniqueConstraint(fields=('provider', 'name'), name='circuits_providernetwork_provider_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('provider', 'name'), name='circuits_providernetwork_provider_name'
|
||||
),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='providernetwork',
|
||||
|
@ -5,7 +5,6 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('circuits', '0003_extend_tag_support'),
|
||||
('circuits', '0004_rename_cable_peer'),
|
||||
@ -14,7 +13,7 @@ class Migration(migrations.Migration):
|
||||
('circuits', '0034_created_datetimefield'),
|
||||
('circuits', '0035_provider_asns'),
|
||||
('circuits', '0036_circuit_termination_date_tags_custom_fields'),
|
||||
('circuits', '0037_new_cabling_models')
|
||||
('circuits', '0037_new_cabling_models'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
|
@ -6,13 +6,12 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('circuits', '0038_cabling_cleanup'),
|
||||
('circuits', '0039_unique_constraints'),
|
||||
('circuits', '0040_provider_remove_deprecated_fields'),
|
||||
('circuits', '0041_standardize_description_comments'),
|
||||
('circuits', '0042_provideraccount')
|
||||
('circuits', '0042_provideraccount'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -51,11 +50,15 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='circuittermination',
|
||||
constraint=models.UniqueConstraint(fields=('circuit', 'term_side'), name='circuits_circuittermination_unique_circuit_term_side'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('circuit', 'term_side'), name='circuits_circuittermination_unique_circuit_term_side'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='providernetwork',
|
||||
constraint=models.UniqueConstraint(fields=('provider', 'name'), name='circuits_providernetwork_unique_provider_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('provider', 'name'), name='circuits_providernetwork_unique_provider_name'
|
||||
),
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='provider',
|
||||
@ -84,12 +87,20 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
(
|
||||
'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)),
|
||||
('provider', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='accounts', to='circuits.provider')),
|
||||
(
|
||||
'provider',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='accounts', to='circuits.provider'
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
options={
|
||||
@ -98,11 +109,17 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='provideraccount',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('name', ''), _negated=True), fields=('provider', 'name'), name='circuits_provideraccount_unique_provider_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('name', ''), _negated=True),
|
||||
fields=('provider', 'name'),
|
||||
name='circuits_provideraccount_unique_provider_name',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='provideraccount',
|
||||
constraint=models.UniqueConstraint(fields=('provider', 'account'), name='circuits_provideraccount_unique_provider_account'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('provider', 'account'), name='circuits_provideraccount_unique_provider_account'
|
||||
),
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='provider',
|
||||
@ -111,7 +128,13 @@ class Migration(migrations.Migration):
|
||||
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'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='circuits',
|
||||
to='circuits.provideraccount',
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
@ -120,6 +143,8 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='circuit',
|
||||
constraint=models.UniqueConstraint(fields=('provider_account', 'cid'), name='circuits_circuit_unique_provideraccount_cid'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('provider_account', 'cid'), name='circuits_circuit_unique_provideraccount_cid'
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('circuits', '0043_circuittype_color'),
|
||||
('extras', '0119_notifications'),
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('circuits', '0044_circuit_groups'),
|
||||
]
|
||||
|
@ -15,7 +15,6 @@ def set_null_values(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('circuits', '0045_circuit_distance'),
|
||||
]
|
||||
@ -36,8 +35,5 @@ class Migration(migrations.Migration):
|
||||
name='cable_end',
|
||||
field=models.CharField(blank=True, max_length=1, null=True),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=set_null_values,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=set_null_values, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -11,19 +11,17 @@ def copy_site_assignments(apps, schema_editor):
|
||||
Site = apps.get_model('dcim', 'Site')
|
||||
|
||||
CircuitTermination.objects.filter(site__isnull=False).update(
|
||||
termination_type=ContentType.objects.get_for_model(Site),
|
||||
termination_id=models.F('site_id')
|
||||
termination_type=ContentType.objects.get_for_model(Site), termination_id=models.F('site_id')
|
||||
)
|
||||
|
||||
ProviderNetwork = apps.get_model('circuits', 'ProviderNetwork')
|
||||
CircuitTermination.objects.filter(provider_network__isnull=False).update(
|
||||
termination_type=ContentType.objects.get_for_model(ProviderNetwork),
|
||||
termination_id=models.F('provider_network_id')
|
||||
termination_id=models.F('provider_network_id'),
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('circuits', '0046_charfield_null_choices'),
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
@ -41,17 +39,15 @@ class Migration(migrations.Migration):
|
||||
name='termination_type',
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
limit_choices_to=models.Q(('model__in', ('region', 'sitegroup', 'site', 'location', 'providernetwork'))),
|
||||
limit_choices_to=models.Q(
|
||||
('model__in', ('region', 'sitegroup', 'site', 'location', 'providernetwork'))
|
||||
),
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
|
||||
# Copy over existing site assignments
|
||||
migrations.RunPython(
|
||||
code=copy_site_assignments,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=copy_site_assignments, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -20,7 +20,6 @@ def populate_denormalized_fields(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('circuits', '0047_circuittermination__termination'),
|
||||
]
|
||||
@ -70,13 +69,8 @@ class Migration(migrations.Migration):
|
||||
to='dcim.sitegroup',
|
||||
),
|
||||
),
|
||||
|
||||
# Populate denormalized FK values
|
||||
migrations.RunPython(
|
||||
code=populate_denormalized_fields,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
|
||||
migrations.RunPython(code=populate_denormalized_fields, reverse_code=migrations.RunPython.noop),
|
||||
# Delete the site ForeignKey
|
||||
migrations.RemoveField(
|
||||
model_name='circuittermination',
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('circuits', '0048_circuitterminations_cached_relations'),
|
||||
('dcim', '0197_natural_sort_collation'),
|
||||
|
@ -6,7 +6,6 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('circuits', '0049_natural_ordering'),
|
||||
('dcim', '0196_qinq_svlan'),
|
||||
@ -21,15 +20,43 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
(
|
||||
'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)),
|
||||
('provider_account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='virtual_circuits', to='circuits.provideraccount')),
|
||||
('provider_network', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='virtual_circuits', to='circuits.providernetwork')),
|
||||
(
|
||||
'provider_account',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='virtual_circuits',
|
||||
to='circuits.provideraccount',
|
||||
),
|
||||
),
|
||||
(
|
||||
'provider_network',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='virtual_circuits',
|
||||
to='circuits.providernetwork',
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='virtual_circuits', to='tenancy.tenant')),
|
||||
(
|
||||
'tenant',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='virtual_circuits',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'circuit',
|
||||
@ -43,12 +70,29 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('role', models.CharField(default='peer', max_length=50)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('interface', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='virtual_circuit_termination', to='dcim.interface')),
|
||||
(
|
||||
'interface',
|
||||
models.OneToOneField(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='virtual_circuit_termination',
|
||||
to='dcim.interface',
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('virtual_circuit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='terminations', to='circuits.virtualcircuit')),
|
||||
(
|
||||
'virtual_circuit',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='terminations',
|
||||
to='circuits.virtualcircuit',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'virtual circuit termination',
|
||||
@ -58,10 +102,14 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='virtualcircuit',
|
||||
constraint=models.UniqueConstraint(fields=('provider_network', 'cid'), name='circuits_virtualcircuit_unique_provider_network_cid'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('provider_network', 'cid'), name='circuits_virtualcircuit_unique_provider_network_cid'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='virtualcircuit',
|
||||
constraint=models.UniqueConstraint(fields=('provider_account', 'cid'), name='circuits_virtualcircuit_unique_provideraccount_cid'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('provider_account', 'cid'), name='circuits_virtualcircuit_unique_provideraccount_cid'
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -8,13 +8,12 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('core', '0001_initial'),
|
||||
('core', '0002_managedfile'),
|
||||
('core', '0003_job'),
|
||||
('core', '0004_replicate_jobresults'),
|
||||
('core', '0005_job_created_auto_now')
|
||||
('core', '0005_job_created_auto_now'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -30,7 +29,10 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
(
|
||||
'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)),
|
||||
@ -55,9 +57,28 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(editable=False)),
|
||||
('path', models.CharField(editable=False, max_length=1000)),
|
||||
('size', models.PositiveIntegerField(editable=False)),
|
||||
('hash', models.CharField(editable=False, max_length=64, validators=[django.core.validators.RegexValidator(message='Length must be 64 hexadecimal characters.', regex='^[0-9a-f]{64}$')])),
|
||||
(
|
||||
'hash',
|
||||
models.CharField(
|
||||
editable=False,
|
||||
max_length=64,
|
||||
validators=[
|
||||
django.core.validators.RegexValidator(
|
||||
message='Length must be 64 hexadecimal characters.', regex='^[0-9a-f]{64}$'
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
('data', models.BinaryField()),
|
||||
('source', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='datafiles', to='core.datasource')),
|
||||
(
|
||||
'source',
|
||||
models.ForeignKey(
|
||||
editable=False,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='datafiles',
|
||||
to='core.datasource',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('source', 'path'),
|
||||
@ -76,8 +97,18 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('object_id', models.PositiveBigIntegerField()),
|
||||
('datafile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='core.datafile')),
|
||||
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype')),
|
||||
(
|
||||
'datafile',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='+', to='core.datafile'
|
||||
),
|
||||
),
|
||||
(
|
||||
'object_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype'
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'indexes': [models.Index(fields=['object_type', 'object_id'], name='core_autosy_object__c17bac_idx')],
|
||||
@ -97,8 +128,26 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(blank=True, editable=False, null=True)),
|
||||
('file_root', models.CharField(max_length=1000)),
|
||||
('file_path', models.FilePathField(editable=False)),
|
||||
('data_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.datafile')),
|
||||
('data_source', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='core.datasource')),
|
||||
(
|
||||
'data_file',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='core.datafile',
|
||||
),
|
||||
),
|
||||
(
|
||||
'data_source',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='core.datasource',
|
||||
),
|
||||
),
|
||||
('auto_sync_enabled', models.BooleanField(default=False)),
|
||||
],
|
||||
options={
|
||||
@ -108,7 +157,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='managedfile',
|
||||
constraint=models.UniqueConstraint(fields=('file_root', 'file_path'), name='core_managedfile_unique_root_path'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('file_root', 'file_path'), name='core_managedfile_unique_root_path'
|
||||
),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Job',
|
||||
@ -118,14 +169,33 @@ class Migration(migrations.Migration):
|
||||
('name', models.CharField(max_length=200)),
|
||||
('created', models.DateTimeField()),
|
||||
('scheduled', models.DateTimeField(blank=True, null=True)),
|
||||
('interval', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
|
||||
(
|
||||
'interval',
|
||||
models.PositiveIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
('started', models.DateTimeField(blank=True, null=True)),
|
||||
('completed', models.DateTimeField(blank=True, null=True)),
|
||||
('status', models.CharField(default='pending', max_length=30)),
|
||||
('data', models.JSONField(blank=True, null=True)),
|
||||
('job_id', models.UUIDField(unique=True)),
|
||||
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobs', to='contenttypes.contenttype')),
|
||||
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'object_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='jobs', to='contenttypes.contenttype'
|
||||
),
|
||||
),
|
||||
(
|
||||
'user',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-created'],
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0005_job_created_auto_now'),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0006_datasource_type_remove_choices'),
|
||||
]
|
||||
|
@ -3,7 +3,6 @@ from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
('core', '0007_job_add_error_field'),
|
||||
@ -12,8 +11,7 @@ class Migration(migrations.Migration):
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ObjectType',
|
||||
fields=[
|
||||
],
|
||||
fields=[],
|
||||
options={
|
||||
'proxy': True,
|
||||
'indexes': [],
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0008_contenttype_proxy'),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0009_configrevision'),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
('core', '0010_gfk_indexes'),
|
||||
@ -27,15 +26,49 @@ class Migration(migrations.Migration):
|
||||
('object_repr', models.CharField(editable=False, max_length=200)),
|
||||
('prechange_data', models.JSONField(blank=True, editable=False, null=True)),
|
||||
('postchange_data', models.JSONField(blank=True, editable=False, null=True)),
|
||||
('changed_object_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype')),
|
||||
('related_object_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype')),
|
||||
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='changes', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'changed_object_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
(
|
||||
'related_object_type',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
(
|
||||
'user',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='changes',
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'object change',
|
||||
'verbose_name_plural': 'object changes',
|
||||
'ordering': ['-time'],
|
||||
'indexes': [models.Index(fields=['changed_object_type', 'changed_object_id'], name='core_object_changed_c227ce_idx'), models.Index(fields=['related_object_type', 'related_object_id'], name='core_object_related_3375d6_idx')],
|
||||
'indexes': [
|
||||
models.Index(
|
||||
fields=['changed_object_type', 'changed_object_id'],
|
||||
name='core_object_changed_c227ce_idx',
|
||||
),
|
||||
models.Index(
|
||||
fields=['related_object_type', 'related_object_id'],
|
||||
name='core_object_related_3375d6_idx',
|
||||
),
|
||||
],
|
||||
},
|
||||
),
|
||||
],
|
||||
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
('core', '0011_move_objectchange'),
|
||||
@ -18,7 +17,7 @@ class Migration(migrations.Migration):
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='jobs',
|
||||
to='contenttypes.contenttype'
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -13,11 +13,9 @@ import utilities.validators
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
dependencies = []
|
||||
|
||||
replaces = [
|
||||
('dcim', '0001_initial'),
|
||||
@ -64,7 +62,12 @@ class Migration(migrations.Migration):
|
||||
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
|
||||
@ -83,7 +86,12 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('type', models.CharField(blank=True, max_length=50)),
|
||||
@ -100,7 +108,12 @@ class Migration(migrations.Migration):
|
||||
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
|
||||
@ -119,7 +132,12 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('type', models.CharField(blank=True, max_length=50)),
|
||||
@ -137,14 +155,34 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('local_context_data', models.JSONField(blank=True, null=True)),
|
||||
('name', models.CharField(blank=True, max_length=64, null=True)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize, null=True)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize, null=True
|
||||
),
|
||||
),
|
||||
('serial', models.CharField(blank=True, max_length=50)),
|
||||
('asset_tag', models.CharField(blank=True, max_length=50, null=True, unique=True)),
|
||||
('position', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
|
||||
(
|
||||
'position',
|
||||
models.PositiveSmallIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
('face', models.CharField(blank=True, max_length=50)),
|
||||
('status', models.CharField(default='active', max_length=50)),
|
||||
('vc_position', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(255)])),
|
||||
('vc_priority', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(255)])),
|
||||
(
|
||||
'vc_position',
|
||||
models.PositiveSmallIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MaxValueValidator(255)]
|
||||
),
|
||||
),
|
||||
(
|
||||
'vc_priority',
|
||||
models.PositiveSmallIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MaxValueValidator(255)]
|
||||
),
|
||||
),
|
||||
('comments', models.TextField(blank=True)),
|
||||
],
|
||||
options={
|
||||
@ -159,7 +197,12 @@ class Migration(migrations.Migration):
|
||||
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
],
|
||||
@ -174,7 +217,12 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
],
|
||||
@ -228,13 +276,27 @@ class Migration(migrations.Migration):
|
||||
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
|
||||
('mark_connected', models.BooleanField(default=False)),
|
||||
('type', models.CharField(max_length=50)),
|
||||
('rear_port_position', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
|
||||
(
|
||||
'rear_port_position',
|
||||
models.PositiveSmallIntegerField(
|
||||
default=1,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(1024),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('device', '_name'),
|
||||
@ -247,11 +309,25 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('type', models.CharField(max_length=50)),
|
||||
('rear_port_position', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
|
||||
(
|
||||
'rear_port_position',
|
||||
models.PositiveSmallIntegerField(
|
||||
default=1,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(1024),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('device_type', '_name'),
|
||||
@ -271,9 +347,24 @@ class Migration(migrations.Migration):
|
||||
('mark_connected', models.BooleanField(default=False)),
|
||||
('enabled', models.BooleanField(default=True)),
|
||||
('mac_address', dcim.fields.MACAddressField(blank=True, null=True)),
|
||||
('mtu', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65536)])),
|
||||
(
|
||||
'mtu',
|
||||
models.PositiveIntegerField(
|
||||
blank=True,
|
||||
null=True,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(65536),
|
||||
],
|
||||
),
|
||||
),
|
||||
('mode', models.CharField(blank=True, max_length=50)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize_interface)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize_interface
|
||||
),
|
||||
),
|
||||
('type', models.CharField(max_length=50)),
|
||||
('mgmt_only', models.BooleanField(default=False)),
|
||||
],
|
||||
@ -290,7 +381,12 @@ class Migration(migrations.Migration):
|
||||
('name', models.CharField(max_length=64)),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize_interface)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize_interface
|
||||
),
|
||||
),
|
||||
('type', models.CharField(max_length=50)),
|
||||
('mgmt_only', models.BooleanField(default=False)),
|
||||
],
|
||||
@ -306,7 +402,12 @@ class Migration(migrations.Migration):
|
||||
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('part_id', models.CharField(blank=True, max_length=50)),
|
||||
@ -388,8 +489,19 @@ class Migration(migrations.Migration):
|
||||
('supply', models.CharField(default='ac', max_length=50)),
|
||||
('phase', models.CharField(default='single-phase', max_length=50)),
|
||||
('voltage', models.SmallIntegerField(validators=[utilities.validators.ExclusionValidator([0])])),
|
||||
('amperage', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1)])),
|
||||
('max_utilization', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)])),
|
||||
(
|
||||
'amperage',
|
||||
models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1)]),
|
||||
),
|
||||
(
|
||||
'max_utilization',
|
||||
models.PositiveSmallIntegerField(
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(100),
|
||||
]
|
||||
),
|
||||
),
|
||||
('available_power', models.PositiveIntegerField(default=0, editable=False)),
|
||||
('comments', models.TextField(blank=True)),
|
||||
],
|
||||
@ -405,7 +517,12 @@ class Migration(migrations.Migration):
|
||||
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
|
||||
@ -424,7 +541,12 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('type', models.CharField(blank=True, max_length=50)),
|
||||
@ -455,14 +577,29 @@ class Migration(migrations.Migration):
|
||||
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
|
||||
('mark_connected', models.BooleanField(default=False)),
|
||||
('type', models.CharField(blank=True, max_length=50)),
|
||||
('maximum_draw', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
|
||||
('allocated_draw', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
|
||||
(
|
||||
'maximum_draw',
|
||||
models.PositiveSmallIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
(
|
||||
'allocated_draw',
|
||||
models.PositiveSmallIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('device', '_name'),
|
||||
@ -475,12 +612,27 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('type', models.CharField(blank=True, max_length=50)),
|
||||
('maximum_draw', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
|
||||
('allocated_draw', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
|
||||
(
|
||||
'maximum_draw',
|
||||
models.PositiveSmallIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
(
|
||||
'allocated_draw',
|
||||
models.PositiveSmallIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('device_type', '_name'),
|
||||
@ -494,14 +646,28 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('facility_id', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('status', models.CharField(default='active', max_length=50)),
|
||||
('serial', models.CharField(blank=True, max_length=50)),
|
||||
('asset_tag', models.CharField(blank=True, max_length=50, null=True, unique=True)),
|
||||
('type', models.CharField(blank=True, max_length=50)),
|
||||
('width', models.PositiveSmallIntegerField(default=19)),
|
||||
('u_height', models.PositiveSmallIntegerField(default=42, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)])),
|
||||
(
|
||||
'u_height',
|
||||
models.PositiveSmallIntegerField(
|
||||
default=42,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(100),
|
||||
],
|
||||
),
|
||||
),
|
||||
('desc_units', models.BooleanField(default=False)),
|
||||
('outer_width', models.PositiveSmallIntegerField(blank=True, null=True)),
|
||||
('outer_depth', models.PositiveSmallIntegerField(blank=True, null=True)),
|
||||
@ -519,7 +685,10 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
('units', django.contrib.postgres.fields.ArrayField(base_field=models.PositiveSmallIntegerField(), size=None)),
|
||||
(
|
||||
'units',
|
||||
django.contrib.postgres.fields.ArrayField(base_field=models.PositiveSmallIntegerField(), size=None),
|
||||
),
|
||||
('description', models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
@ -550,13 +719,27 @@ class Migration(migrations.Migration):
|
||||
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
|
||||
('mark_connected', models.BooleanField(default=False)),
|
||||
('type', models.CharField(max_length=50)),
|
||||
('positions', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
|
||||
(
|
||||
'positions',
|
||||
models.PositiveSmallIntegerField(
|
||||
default=1,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(1024),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('device', '_name'),
|
||||
@ -569,11 +752,25 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('type', models.CharField(max_length=50)),
|
||||
('positions', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
|
||||
(
|
||||
'positions',
|
||||
models.PositiveSmallIntegerField(
|
||||
default=1,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(1024),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('device_type', '_name'),
|
||||
@ -606,7 +803,12 @@ class Migration(migrations.Migration):
|
||||
('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, unique=True)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('slug', models.SlugField(max_length=100, unique=True)),
|
||||
('status', models.CharField(default='active', max_length=50)),
|
||||
('facility', models.CharField(blank=True, max_length=50)),
|
||||
@ -654,7 +856,16 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('domain', models.CharField(blank=True, max_length=30)),
|
||||
('master', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vc_master_for', to='dcim.device')),
|
||||
(
|
||||
'master',
|
||||
models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='vc_master_for',
|
||||
to='dcim.device',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'virtual chassis',
|
||||
|
@ -6,7 +6,6 @@ import taggit.managers
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
@ -28,17 +27,35 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='sitegroup',
|
||||
name='parent',
|
||||
field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='dcim.sitegroup'),
|
||||
field=mptt.fields.TreeForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='children',
|
||||
to='dcim.sitegroup',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='site',
|
||||
name='group',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sites', to='dcim.sitegroup'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='sites',
|
||||
to='dcim.sitegroup',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='site',
|
||||
name='region',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sites', to='dcim.region'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='sites',
|
||||
to='dcim.region',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='site',
|
||||
@ -48,32 +65,56 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='site',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='sites', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='sites',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='region',
|
||||
name='parent',
|
||||
field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='dcim.region'),
|
||||
field=mptt.fields.TreeForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='children',
|
||||
to='dcim.region',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='rearporttemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='rearport',
|
||||
name='_cable_peer_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='rearport',
|
||||
name='cable',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='dcim.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='rearport',
|
||||
name='device',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='rearport',
|
||||
@ -83,7 +124,9 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='rackreservation',
|
||||
name='rack',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to='dcim.rack'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to='dcim.rack'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='rackreservation',
|
||||
@ -93,7 +136,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='rackreservation',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='rackreservations', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='rackreservations',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='rackreservation',
|
||||
@ -103,12 +152,24 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='rack',
|
||||
name='location',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='racks', to='dcim.location'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='racks',
|
||||
to='dcim.location',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='rack',
|
||||
name='role',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='racks', to='dcim.rackrole'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='racks',
|
||||
to='dcim.rackrole',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='rack',
|
||||
@ -123,32 +184,52 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='rack',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='racks', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='racks',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerporttemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerport',
|
||||
name='_cable_peer_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerport',
|
||||
name='_path',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerport',
|
||||
name='cable',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='dcim.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='powerport',
|
||||
name='device',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerport',
|
||||
@ -158,7 +239,9 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='powerpanel',
|
||||
name='location',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='dcim.location'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='dcim.location'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerpanel',
|
||||
@ -173,37 +256,63 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='poweroutlettemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='poweroutlettemplate',
|
||||
name='power_port',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='poweroutlet_templates', to='dcim.powerporttemplate'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='poweroutlet_templates',
|
||||
to='dcim.powerporttemplate',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='poweroutlet',
|
||||
name='_cable_peer_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='poweroutlet',
|
||||
name='_path',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='poweroutlet',
|
||||
name='cable',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='dcim.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='poweroutlet',
|
||||
name='device',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='poweroutlet',
|
||||
name='power_port',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='poweroutlets', to='dcim.powerport'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='poweroutlets',
|
||||
to='dcim.powerport',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='poweroutlet',
|
||||
@ -213,27 +322,45 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='powerfeed',
|
||||
name='_cable_peer_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerfeed',
|
||||
name='_path',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerfeed',
|
||||
name='cable',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='dcim.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='powerfeed',
|
||||
name='power_panel',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='powerfeeds', to='dcim.powerpanel'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='powerfeeds', to='dcim.powerpanel'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerfeed',
|
||||
name='rack',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='powerfeeds', to='dcim.rack'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='powerfeeds',
|
||||
to='dcim.rack',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerfeed',
|
||||
@ -243,32 +370,60 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='platform',
|
||||
name='manufacturer',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='platforms', to='dcim.manufacturer'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='platforms',
|
||||
to='dcim.manufacturer',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location',
|
||||
name='parent',
|
||||
field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='dcim.location'),
|
||||
field=mptt.fields.TreeForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='children',
|
||||
to='dcim.location',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location',
|
||||
name='site',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='locations', to='dcim.site'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='locations', to='dcim.site'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='inventoryitem',
|
||||
name='device',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='inventoryitem',
|
||||
name='manufacturer',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inventory_items', to='dcim.manufacturer'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='inventory_items',
|
||||
to='dcim.manufacturer',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='inventoryitem',
|
||||
name='parent',
|
||||
field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='child_items', to='dcim.inventoryitem'),
|
||||
field=mptt.fields.TreeForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='child_items',
|
||||
to='dcim.inventoryitem',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='inventoryitem',
|
||||
@ -278,36 +433,62 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='interfacetemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='_cable_peer_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='_path',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='cable',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='dcim.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='interface',
|
||||
name='device',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='lag',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='member_interfaces', to='dcim.interface'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='member_interfaces',
|
||||
to='dcim.interface',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='parent',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='child_interfaces', to='dcim.interface'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='child_interfaces',
|
||||
to='dcim.interface',
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ import taggit.managers
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0002_auto_20160622_1821'),
|
||||
('virtualization', '0001_virtualization'),
|
||||
@ -160,37 +159,61 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='untagged_vlan',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='interfaces_as_untagged', to='ipam.vlan'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='interfaces_as_untagged',
|
||||
to='ipam.vlan',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='frontporttemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='frontporttemplate',
|
||||
name='rear_port',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='frontport_templates', to='dcim.rearporttemplate'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='frontport_templates',
|
||||
to='dcim.rearporttemplate',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='frontport',
|
||||
name='_cable_peer_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='frontport',
|
||||
name='cable',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='dcim.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='frontport',
|
||||
name='device',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='frontport',
|
||||
name='rear_port',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='frontports', to='dcim.rearport'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='frontports', to='dcim.rearport'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='frontport',
|
||||
@ -200,7 +223,9 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='manufacturer',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='device_types', to='dcim.manufacturer'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='device_types', to='dcim.manufacturer'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
@ -210,17 +235,27 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='devicebaytemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicebay',
|
||||
name='device',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicebay',
|
||||
name='installed_device',
|
||||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='parent_bay', to='dcim.device'),
|
||||
field=models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='parent_bay',
|
||||
to='dcim.device',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicebay',
|
||||
@ -230,47 +265,89 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='cluster',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='devices', to='virtualization.cluster'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='devices',
|
||||
to='virtualization.cluster',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='device_role',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='dcim.devicerole'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='dcim.devicerole'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='instances', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='instances', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='location',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='dcim.location'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='devices',
|
||||
to='dcim.location',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='platform',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='devices', to='dcim.platform'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='devices',
|
||||
to='dcim.platform',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='primary_ip4',
|
||||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='primary_ip4_for', to='ipam.ipaddress'),
|
||||
field=models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='primary_ip4_for',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='primary_ip6',
|
||||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='primary_ip6_for', to='ipam.ipaddress'),
|
||||
field=models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='primary_ip6_for',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='rack',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='dcim.rack'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='devices',
|
||||
to='dcim.rack',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='site',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='dcim.site'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='dcim.site'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
@ -280,37 +357,63 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='devices',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='virtual_chassis',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='members', to='dcim.virtualchassis'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='members',
|
||||
to='dcim.virtualchassis',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleserverporttemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleserverport',
|
||||
name='_cable_peer_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleserverport',
|
||||
name='_path',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleserverport',
|
||||
name='cable',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='dcim.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='consoleserverport',
|
||||
name='device',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleserverport',
|
||||
@ -320,27 +423,41 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='consoleporttemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleport',
|
||||
name='_cable_peer_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleport',
|
||||
name='_path',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dcim.cablepath'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleport',
|
||||
name='cable',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='dcim.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='consoleport',
|
||||
name='device',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleport',
|
||||
@ -350,22 +467,34 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='cablepath',
|
||||
name='destination_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cablepath',
|
||||
name='origin_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cable',
|
||||
name='_termination_a_device',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cable',
|
||||
name='_termination_b_device',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='dcim.device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cable',
|
||||
@ -375,12 +504,64 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='cable',
|
||||
name='termination_a_type',
|
||||
field=models.ForeignKey(limit_choices_to=models.Q(models.Q(models.Q(('app_label', 'circuits'), ('model__in', ('circuittermination',))), models.Q(('app_label', 'dcim'), ('model__in', ('consoleport', 'consoleserverport', 'frontport', 'interface', 'powerfeed', 'poweroutlet', 'powerport', 'rearport'))), _connector='OR')), on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
limit_choices_to=models.Q(
|
||||
models.Q(
|
||||
models.Q(('app_label', 'circuits'), ('model__in', ('circuittermination',))),
|
||||
models.Q(
|
||||
('app_label', 'dcim'),
|
||||
(
|
||||
'model__in',
|
||||
(
|
||||
'consoleport',
|
||||
'consoleserverport',
|
||||
'frontport',
|
||||
'interface',
|
||||
'powerfeed',
|
||||
'poweroutlet',
|
||||
'powerport',
|
||||
'rearport',
|
||||
),
|
||||
),
|
||||
),
|
||||
_connector='OR',
|
||||
)
|
||||
),
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cable',
|
||||
name='termination_b_type',
|
||||
field=models.ForeignKey(limit_choices_to=models.Q(models.Q(models.Q(('app_label', 'circuits'), ('model__in', ('circuittermination',))), models.Q(('app_label', 'dcim'), ('model__in', ('consoleport', 'consoleserverport', 'frontport', 'interface', 'powerfeed', 'poweroutlet', 'powerport', 'rearport'))), _connector='OR')), on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
limit_choices_to=models.Q(
|
||||
models.Q(
|
||||
models.Q(('app_label', 'circuits'), ('model__in', ('circuittermination',))),
|
||||
models.Q(
|
||||
('app_label', 'dcim'),
|
||||
(
|
||||
'model__in',
|
||||
(
|
||||
'consoleport',
|
||||
'consoleserverport',
|
||||
'frontport',
|
||||
'interface',
|
||||
'powerfeed',
|
||||
'poweroutlet',
|
||||
'powerport',
|
||||
'rearport',
|
||||
),
|
||||
),
|
||||
),
|
||||
_connector='OR',
|
||||
)
|
||||
),
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='rearporttemplate',
|
||||
@ -456,7 +637,11 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='device',
|
||||
unique_together={('rack', 'position', 'face'), ('virtual_chassis', 'vc_position'), ('site', 'tenant', 'name')},
|
||||
unique_together={
|
||||
('rack', 'position', 'face'),
|
||||
('virtual_chassis', 'vc_position'),
|
||||
('site', 'tenant', 'name'),
|
||||
},
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='consoleserverporttemplate',
|
||||
|
@ -10,7 +10,6 @@ import utilities.ordering
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('dcim', '0131_consoleport_speed'),
|
||||
('dcim', '0132_cable_length'),
|
||||
@ -40,7 +39,7 @@ class Migration(migrations.Migration):
|
||||
('dcim', '0156_location_status'),
|
||||
('dcim', '0157_new_cabling_models'),
|
||||
('dcim', '0158_populate_cable_terminations'),
|
||||
('dcim', '0159_populate_cable_paths')
|
||||
('dcim', '0159_populate_cable_paths'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -96,17 +95,35 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='bridge',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='bridge_interfaces', to='dcim.interface'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='bridge_interfaces',
|
||||
to='dcim.interface',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='locations', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='locations',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cable',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='cables', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='cables',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
@ -148,7 +165,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='location',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent', None)), fields=('site', 'name'), name='dcim_location_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent', None)), fields=('site', 'name'), name='dcim_location_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='location',
|
||||
@ -156,7 +175,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='location',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent', None)), fields=('site', 'slug'), name='dcim_location_slug'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent', None)), fields=('site', 'slug'), name='dcim_location_slug'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='region',
|
||||
@ -164,7 +185,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='region',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent', None)), fields=('name',), name='dcim_region_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent', None)), fields=('name',), name='dcim_region_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='region',
|
||||
@ -172,7 +195,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='region',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent', None)), fields=('slug',), name='dcim_region_slug'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent', None)), fields=('slug',), name='dcim_region_slug'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='sitegroup',
|
||||
@ -180,7 +205,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='sitegroup',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent', None)), fields=('name',), name='dcim_sitegroup_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent', None)), fields=('name',), name='dcim_sitegroup_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='sitegroup',
|
||||
@ -188,7 +215,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='sitegroup',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent', None)), fields=('slug',), name='dcim_sitegroup_slug'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent', None)), fields=('slug',), name='dcim_sitegroup_slug'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicerole',
|
||||
@ -328,7 +357,9 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='tx_power',
|
||||
field=models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(127)]),
|
||||
field=models.PositiveSmallIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MaxValueValidator(127)]
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
@ -338,7 +369,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='wireless_link',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wireless.wirelesslink'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='wireless.wirelesslink',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='site',
|
||||
@ -348,12 +385,24 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='device',
|
||||
name='primary_ip4',
|
||||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='ipam.ipaddress'),
|
||||
field=models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='device',
|
||||
name='primary_ip6',
|
||||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='ipam.ipaddress'),
|
||||
field=models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='site',
|
||||
@ -405,49 +454,99 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='consoleporttemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.devicetype',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='consoleserverporttemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.devicetype',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='frontporttemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.devicetype',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='interfacetemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.devicetype',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='poweroutlettemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.devicetype',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='powerporttemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.devicetype',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='rearporttemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.devicetype',
|
||||
),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ModuleType',
|
||||
fields=[
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('model', models.CharField(max_length=100)),
|
||||
('part_number', models.CharField(blank=True, max_length=50)),
|
||||
('comments', models.TextField(blank=True)),
|
||||
('manufacturer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='module_types', to='dcim.manufacturer')),
|
||||
(
|
||||
'manufacturer',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='module_types', to='dcim.manufacturer'
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
options={
|
||||
@ -460,14 +559,27 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('position', models.CharField(blank=True, max_length=30)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device')),
|
||||
(
|
||||
'device',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.device'
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
options={
|
||||
@ -480,15 +592,35 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('local_context_data', models.JSONField(blank=True, null=True)),
|
||||
('serial', models.CharField(blank=True, max_length=50)),
|
||||
('asset_tag', models.CharField(blank=True, max_length=50, null=True, unique=True)),
|
||||
('comments', models.TextField(blank=True)),
|
||||
('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='modules', to='dcim.device')),
|
||||
('module_bay', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='installed_module', to='dcim.modulebay')),
|
||||
('module_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='instances', to='dcim.moduletype')),
|
||||
(
|
||||
'device',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='modules', to='dcim.device'
|
||||
),
|
||||
),
|
||||
(
|
||||
'module_bay',
|
||||
models.OneToOneField(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='installed_module',
|
||||
to='dcim.modulebay',
|
||||
),
|
||||
),
|
||||
(
|
||||
'module_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='instances', to='dcim.moduletype'
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
options={
|
||||
@ -498,72 +630,156 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='consoleport',
|
||||
name='module',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.module'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.module',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleporttemplate',
|
||||
name='module_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.moduletype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.moduletype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleserverport',
|
||||
name='module',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.module'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.module',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='consoleserverporttemplate',
|
||||
name='module_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.moduletype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.moduletype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='frontport',
|
||||
name='module',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.module'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.module',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='frontporttemplate',
|
||||
name='module_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.moduletype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.moduletype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='module',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.module'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.module',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interfacetemplate',
|
||||
name='module_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.moduletype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.moduletype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='poweroutlet',
|
||||
name='module',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.module'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.module',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='poweroutlettemplate',
|
||||
name='module_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.moduletype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.moduletype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerport',
|
||||
name='module',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.module'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.module',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='powerporttemplate',
|
||||
name='module_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.moduletype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.moduletype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='rearport',
|
||||
name='module',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.module'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.module',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='rearporttemplate',
|
||||
name='module_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.moduletype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.moduletype',
|
||||
),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='consoleporttemplate',
|
||||
@ -598,7 +814,10 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('slug', models.SlugField(max_length=100, unique=True)),
|
||||
@ -613,7 +832,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='inventoryitem',
|
||||
name='role',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inventory_items', to='dcim.inventoryitemrole'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='inventory_items',
|
||||
to='dcim.inventoryitemrole',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='inventoryitem',
|
||||
@ -623,12 +848,39 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='inventoryitem',
|
||||
name='component_type',
|
||||
field=models.ForeignKey(blank=True, limit_choices_to=models.Q(('app_label', 'dcim'), ('model__in', ('consoleport', 'consoleserverport', 'frontport', 'interface', 'poweroutlet', 'powerport', 'rearport'))), null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
limit_choices_to=models.Q(
|
||||
('app_label', 'dcim'),
|
||||
(
|
||||
'model__in',
|
||||
(
|
||||
'consoleport',
|
||||
'consoleserverport',
|
||||
'frontport',
|
||||
'interface',
|
||||
'poweroutlet',
|
||||
'powerport',
|
||||
'rearport',
|
||||
),
|
||||
),
|
||||
),
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='vrf',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='interfaces', to='ipam.vrf'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='interfaces',
|
||||
to='ipam.vrf',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
@ -952,7 +1204,12 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('component_id', models.PositiveBigIntegerField(blank=True, null=True)),
|
||||
@ -961,11 +1218,67 @@ class Migration(migrations.Migration):
|
||||
('rght', models.PositiveIntegerField(editable=False)),
|
||||
('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
||||
('level', models.PositiveIntegerField(editable=False)),
|
||||
('component_type', models.ForeignKey(blank=True, limit_choices_to=models.Q(('app_label', 'dcim'), ('model__in', ('consoleporttemplate', 'consoleserverporttemplate', 'frontporttemplate', 'interfacetemplate', 'poweroutlettemplate', 'powerporttemplate', 'rearporttemplate'))), null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype')),
|
||||
('device_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype')),
|
||||
('manufacturer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inventory_item_templates', to='dcim.manufacturer')),
|
||||
('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='child_items', to='dcim.inventoryitemtemplate')),
|
||||
('role', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inventory_item_templates', to='dcim.inventoryitemrole')),
|
||||
(
|
||||
'component_type',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
limit_choices_to=models.Q(
|
||||
('app_label', 'dcim'),
|
||||
(
|
||||
'model__in',
|
||||
(
|
||||
'consoleporttemplate',
|
||||
'consoleserverporttemplate',
|
||||
'frontporttemplate',
|
||||
'interfacetemplate',
|
||||
'poweroutlettemplate',
|
||||
'powerporttemplate',
|
||||
'rearporttemplate',
|
||||
),
|
||||
),
|
||||
),
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
(
|
||||
'device_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
(
|
||||
'manufacturer',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='inventory_item_templates',
|
||||
to='dcim.manufacturer',
|
||||
),
|
||||
),
|
||||
(
|
||||
'parent',
|
||||
mptt.fields.TreeForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='child_items',
|
||||
to='dcim.inventoryitemtemplate',
|
||||
),
|
||||
),
|
||||
(
|
||||
'role',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='inventory_item_templates',
|
||||
to='dcim.inventoryitemrole',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('device_type__id', 'parent__id', '_name'),
|
||||
@ -989,11 +1302,21 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
('label', models.CharField(blank=True, max_length=64)),
|
||||
('position', models.CharField(blank=True, max_length=30)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('device_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype')),
|
||||
(
|
||||
'device_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('device_type', '_name'),
|
||||
@ -1088,7 +1411,16 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='device',
|
||||
name='position',
|
||||
field=models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100.5)]),
|
||||
field=models.DecimalField(
|
||||
blank=True,
|
||||
decimal_places=1,
|
||||
max_digits=4,
|
||||
null=True,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(100.5),
|
||||
],
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
@ -1121,12 +1453,66 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('cable_end', models.CharField(max_length=1)),
|
||||
('termination_id', models.PositiveBigIntegerField()),
|
||||
('cable', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='terminations', to='dcim.cable')),
|
||||
('termination_type', models.ForeignKey(limit_choices_to=models.Q(models.Q(models.Q(('app_label', 'circuits'), ('model__in', ('circuittermination',))), models.Q(('app_label', 'dcim'), ('model__in', ('consoleport', 'consoleserverport', 'frontport', 'interface', 'powerfeed', 'poweroutlet', 'powerport', 'rearport'))), _connector='OR')), on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype')),
|
||||
('_device', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.device')),
|
||||
('_rack', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.rack')),
|
||||
('_location', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.location')),
|
||||
('_site', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.site')),
|
||||
(
|
||||
'cable',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='terminations', to='dcim.cable'
|
||||
),
|
||||
),
|
||||
(
|
||||
'termination_type',
|
||||
models.ForeignKey(
|
||||
limit_choices_to=models.Q(
|
||||
models.Q(
|
||||
models.Q(('app_label', 'circuits'), ('model__in', ('circuittermination',))),
|
||||
models.Q(
|
||||
('app_label', 'dcim'),
|
||||
(
|
||||
'model__in',
|
||||
(
|
||||
'consoleport',
|
||||
'consoleserverport',
|
||||
'frontport',
|
||||
'interface',
|
||||
'powerfeed',
|
||||
'poweroutlet',
|
||||
'powerport',
|
||||
'rearport',
|
||||
),
|
||||
),
|
||||
),
|
||||
_connector='OR',
|
||||
)
|
||||
),
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
(
|
||||
'_device',
|
||||
models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.device'
|
||||
),
|
||||
),
|
||||
(
|
||||
'_rack',
|
||||
models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.rack'
|
||||
),
|
||||
),
|
||||
(
|
||||
'_location',
|
||||
models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.location'
|
||||
),
|
||||
),
|
||||
(
|
||||
'_site',
|
||||
models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.site'
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('cable', 'cable_end', 'pk'),
|
||||
@ -1134,7 +1520,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='cabletermination',
|
||||
constraint=models.UniqueConstraint(fields=('termination_type', 'termination_id'), name='dcim_cable_termination_unique_termination'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('termination_type', 'termination_id'), name='dcim_cable_termination_unique_termination'
|
||||
),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='cablepath',
|
||||
|
@ -6,7 +6,6 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('dcim', '0160_populate_cable_ends'),
|
||||
('dcim', '0161_cabling_cleanup'),
|
||||
@ -14,7 +13,7 @@ class Migration(migrations.Migration):
|
||||
('dcim', '0163_weight_fields'),
|
||||
('dcim', '0164_rack_mounting_depth'),
|
||||
('dcim', '0165_standardize_description_comments'),
|
||||
('dcim', '0166_virtualdevicecontext')
|
||||
('dcim', '0166_virtualdevicecontext'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -275,7 +274,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='cabletermination',
|
||||
constraint=models.UniqueConstraint(fields=('termination_type', 'termination_id'), name='dcim_cabletermination_unique_termination'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('termination_type', 'termination_id'), name='dcim_cabletermination_unique_termination'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='consoleport',
|
||||
@ -283,39 +284,64 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='consoleporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('device_type', 'name'), name='dcim_consoleporttemplate_unique_device_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device_type', 'name'), name='dcim_consoleporttemplate_unique_device_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='consoleporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('module_type', 'name'), name='dcim_consoleporttemplate_unique_module_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('module_type', 'name'), name='dcim_consoleporttemplate_unique_module_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='consoleserverport',
|
||||
constraint=models.UniqueConstraint(fields=('device', 'name'), name='dcim_consoleserverport_unique_device_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device', 'name'), name='dcim_consoleserverport_unique_device_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='consoleserverporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('device_type', 'name'), name='dcim_consoleserverporttemplate_unique_device_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device_type', 'name'), name='dcim_consoleserverporttemplate_unique_device_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='consoleserverporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('module_type', 'name'), name='dcim_consoleserverporttemplate_unique_module_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('module_type', 'name'), name='dcim_consoleserverporttemplate_unique_module_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='device',
|
||||
constraint=models.UniqueConstraint(django.db.models.functions.text.Lower('name'), models.F('site'), models.F('tenant'), name='dcim_device_unique_name_site_tenant'),
|
||||
constraint=models.UniqueConstraint(
|
||||
django.db.models.functions.text.Lower('name'),
|
||||
models.F('site'),
|
||||
models.F('tenant'),
|
||||
name='dcim_device_unique_name_site_tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='device',
|
||||
constraint=models.UniqueConstraint(django.db.models.functions.text.Lower('name'), models.F('site'), condition=models.Q(('tenant__isnull', True)), name='dcim_device_unique_name_site', violation_error_message='Device name must be unique per site.'),
|
||||
constraint=models.UniqueConstraint(
|
||||
django.db.models.functions.text.Lower('name'),
|
||||
models.F('site'),
|
||||
condition=models.Q(('tenant__isnull', True)),
|
||||
name='dcim_device_unique_name_site',
|
||||
violation_error_message='Device name must be unique per site.',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='device',
|
||||
constraint=models.UniqueConstraint(fields=('rack', 'position', 'face'), name='dcim_device_unique_rack_position_face'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('rack', 'position', 'face'), name='dcim_device_unique_rack_position_face'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='device',
|
||||
constraint=models.UniqueConstraint(fields=('virtual_chassis', 'vc_position'), name='dcim_device_unique_virtual_chassis_vc_position'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('virtual_chassis', 'vc_position'), name='dcim_device_unique_virtual_chassis_vc_position'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='devicebay',
|
||||
@ -323,15 +349,21 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='devicebaytemplate',
|
||||
constraint=models.UniqueConstraint(fields=('device_type', 'name'), name='dcim_devicebaytemplate_unique_device_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device_type', 'name'), name='dcim_devicebaytemplate_unique_device_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='devicetype',
|
||||
constraint=models.UniqueConstraint(fields=('manufacturer', 'model'), name='dcim_devicetype_unique_manufacturer_model'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('manufacturer', 'model'), name='dcim_devicetype_unique_manufacturer_model'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='devicetype',
|
||||
constraint=models.UniqueConstraint(fields=('manufacturer', 'slug'), name='dcim_devicetype_unique_manufacturer_slug'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('manufacturer', 'slug'), name='dcim_devicetype_unique_manufacturer_slug'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='frontport',
|
||||
@ -339,19 +371,27 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='frontport',
|
||||
constraint=models.UniqueConstraint(fields=('rear_port', 'rear_port_position'), name='dcim_frontport_unique_rear_port_position'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('rear_port', 'rear_port_position'), name='dcim_frontport_unique_rear_port_position'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='frontporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('device_type', 'name'), name='dcim_frontporttemplate_unique_device_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device_type', 'name'), name='dcim_frontporttemplate_unique_device_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='frontporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('module_type', 'name'), name='dcim_frontporttemplate_unique_module_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('module_type', 'name'), name='dcim_frontporttemplate_unique_module_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='frontporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('rear_port', 'rear_port_position'), name='dcim_frontporttemplate_unique_rear_port_position'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('rear_port', 'rear_port_position'), name='dcim_frontporttemplate_unique_rear_port_position'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='interface',
|
||||
@ -359,27 +399,46 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='interfacetemplate',
|
||||
constraint=models.UniqueConstraint(fields=('device_type', 'name'), name='dcim_interfacetemplate_unique_device_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device_type', 'name'), name='dcim_interfacetemplate_unique_device_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='interfacetemplate',
|
||||
constraint=models.UniqueConstraint(fields=('module_type', 'name'), name='dcim_interfacetemplate_unique_module_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('module_type', 'name'), name='dcim_interfacetemplate_unique_module_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='inventoryitem',
|
||||
constraint=models.UniqueConstraint(fields=('device', 'parent', 'name'), name='dcim_inventoryitem_unique_device_parent_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device', 'parent', 'name'), name='dcim_inventoryitem_unique_device_parent_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='inventoryitemtemplate',
|
||||
constraint=models.UniqueConstraint(fields=('device_type', 'parent', 'name'), name='dcim_inventoryitemtemplate_unique_device_type_parent_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device_type', 'parent', 'name'),
|
||||
name='dcim_inventoryitemtemplate_unique_device_type_parent_name',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='location',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent__isnull', True)), fields=('site', 'name'), name='dcim_location_name', violation_error_message='A location with this name already exists within the specified site.'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent__isnull', True)),
|
||||
fields=('site', 'name'),
|
||||
name='dcim_location_name',
|
||||
violation_error_message='A location with this name already exists within the specified site.',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='location',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent__isnull', True)), fields=('site', 'slug'), name='dcim_location_slug', violation_error_message='A location with this slug already exists within the specified site.'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent__isnull', True)),
|
||||
fields=('site', 'slug'),
|
||||
name='dcim_location_slug',
|
||||
violation_error_message='A location with this slug already exists within the specified site.',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='modulebay',
|
||||
@ -387,15 +446,21 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='modulebaytemplate',
|
||||
constraint=models.UniqueConstraint(fields=('device_type', 'name'), name='dcim_modulebaytemplate_unique_device_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device_type', 'name'), name='dcim_modulebaytemplate_unique_device_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='moduletype',
|
||||
constraint=models.UniqueConstraint(fields=('manufacturer', 'model'), name='dcim_moduletype_unique_manufacturer_model'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('manufacturer', 'model'), name='dcim_moduletype_unique_manufacturer_model'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='powerfeed',
|
||||
constraint=models.UniqueConstraint(fields=('power_panel', 'name'), name='dcim_powerfeed_unique_power_panel_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('power_panel', 'name'), name='dcim_powerfeed_unique_power_panel_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='poweroutlet',
|
||||
@ -403,11 +468,15 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='poweroutlettemplate',
|
||||
constraint=models.UniqueConstraint(fields=('device_type', 'name'), name='dcim_poweroutlettemplate_unique_device_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device_type', 'name'), name='dcim_poweroutlettemplate_unique_device_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='poweroutlettemplate',
|
||||
constraint=models.UniqueConstraint(fields=('module_type', 'name'), name='dcim_poweroutlettemplate_unique_module_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('module_type', 'name'), name='dcim_poweroutlettemplate_unique_module_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='powerpanel',
|
||||
@ -419,11 +488,15 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='powerporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('device_type', 'name'), name='dcim_powerporttemplate_unique_device_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device_type', 'name'), name='dcim_powerporttemplate_unique_device_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='powerporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('module_type', 'name'), name='dcim_powerporttemplate_unique_module_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('module_type', 'name'), name='dcim_powerporttemplate_unique_module_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='rack',
|
||||
@ -431,7 +504,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='rack',
|
||||
constraint=models.UniqueConstraint(fields=('location', 'facility_id'), name='dcim_rack_unique_location_facility_id'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('location', 'facility_id'), name='dcim_rack_unique_location_facility_id'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='rearport',
|
||||
@ -439,27 +514,51 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='rearporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('device_type', 'name'), name='dcim_rearporttemplate_unique_device_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device_type', 'name'), name='dcim_rearporttemplate_unique_device_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='rearporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('module_type', 'name'), name='dcim_rearporttemplate_unique_module_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('module_type', 'name'), name='dcim_rearporttemplate_unique_module_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='region',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent__isnull', True)), fields=('name',), name='dcim_region_name', violation_error_message='A top-level region with this name already exists.'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent__isnull', True)),
|
||||
fields=('name',),
|
||||
name='dcim_region_name',
|
||||
violation_error_message='A top-level region with this name already exists.',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='region',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent__isnull', True)), fields=('slug',), name='dcim_region_slug', violation_error_message='A top-level region with this slug already exists.'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent__isnull', True)),
|
||||
fields=('slug',),
|
||||
name='dcim_region_slug',
|
||||
violation_error_message='A top-level region with this slug already exists.',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='sitegroup',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent__isnull', True)), fields=('name',), name='dcim_sitegroup_name', violation_error_message='A top-level site group with this name already exists.'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent__isnull', True)),
|
||||
fields=('name',),
|
||||
name='dcim_sitegroup_name',
|
||||
violation_error_message='A top-level site group with this name already exists.',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='sitegroup',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('parent__isnull', True)), fields=('slug',), name='dcim_sitegroup_slug', violation_error_message='A top-level site group with this slug already exists.'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('parent__isnull', True)),
|
||||
fields=('slug',),
|
||||
name='dcim_sitegroup_slug',
|
||||
violation_error_message='A top-level site group with this slug already exists.',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
@ -592,17 +691,56 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('status', models.CharField(max_length=50)),
|
||||
('identifier', models.PositiveSmallIntegerField(blank=True, null=True)),
|
||||
('comments', models.TextField(blank=True)),
|
||||
('device', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vdcs', to='dcim.device')),
|
||||
('primary_ip4', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='ipam.ipaddress')),
|
||||
('primary_ip6', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='ipam.ipaddress')),
|
||||
(
|
||||
'device',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='vdcs',
|
||||
to='dcim.device',
|
||||
),
|
||||
),
|
||||
(
|
||||
'primary_ip4',
|
||||
models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
(
|
||||
'primary_ip6',
|
||||
models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vdcs', to='tenancy.tenant')),
|
||||
(
|
||||
'tenant',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='vdcs',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
@ -615,7 +753,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='virtualdevicecontext',
|
||||
constraint=models.UniqueConstraint(fields=('device', 'identifier'), name='dcim_virtualdevicecontext_device_identifier'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device', 'identifier'), name='dcim_virtualdevicecontext_device_identifier'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='virtualdevicecontext',
|
||||
|
@ -6,7 +6,6 @@ import utilities.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('dcim', '0167_module_status'),
|
||||
('dcim', '0168_interface_template_enabled'),
|
||||
@ -24,7 +23,7 @@ class Migration(migrations.Migration):
|
||||
('dcim', '0179_interfacetemplate_rf_role'),
|
||||
('dcim', '0180_powerfeed_tenant'),
|
||||
('dcim', '0181_rename_device_role_device_role'),
|
||||
('dcim', '0182_zero_length_cable_fix')
|
||||
('dcim', '0182_zero_length_cable_fix'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -48,27 +47,57 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='interfacetemplate',
|
||||
name='bridge',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='bridge_interfaces', to='dcim.interfacetemplate'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='bridge_interfaces',
|
||||
to='dcim.interfacetemplate',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='default_platform',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='dcim.platform'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='dcim.platform',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='config_template',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='%(class)ss', to='extras.configtemplate'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='%(class)ss',
|
||||
to='extras.configtemplate',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicerole',
|
||||
name='config_template',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='device_roles', to='extras.configtemplate'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='device_roles',
|
||||
to='extras.configtemplate',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='platform',
|
||||
name='config_template',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='platforms', to='extras.configtemplate'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='platforms',
|
||||
to='extras.configtemplate',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cabletermination',
|
||||
@ -83,22 +112,30 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='powerport',
|
||||
name='allocated_draw',
|
||||
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]),
|
||||
field=models.PositiveIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='powerport',
|
||||
name='maximum_draw',
|
||||
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]),
|
||||
field=models.PositiveIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='powerporttemplate',
|
||||
name='allocated_draw',
|
||||
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]),
|
||||
field=models.PositiveIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='powerporttemplate',
|
||||
name='maximum_draw',
|
||||
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]),
|
||||
field=models.PositiveIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='platform',
|
||||
@ -126,112 +163,160 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='oob_ip',
|
||||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='ipam.ipaddress'),
|
||||
field=models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='console_port_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.ConsolePort'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device', to_model='dcim.ConsolePort'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='console_server_port_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.ConsoleServerPort'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device', to_model='dcim.ConsoleServerPort'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='power_port_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.PowerPort'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device', to_model='dcim.PowerPort'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='power_outlet_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.PowerOutlet'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device', to_model='dcim.PowerOutlet'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='interface_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.Interface'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device', to_model='dcim.Interface'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='front_port_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.FrontPort'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device', to_model='dcim.FrontPort'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='rear_port_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.RearPort'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device', to_model='dcim.RearPort'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='device_bay_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.DeviceBay'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device', to_model='dcim.DeviceBay'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='module_bay_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.ModuleBay'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device', to_model='dcim.ModuleBay'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='device',
|
||||
name='inventory_item_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device', to_model='dcim.InventoryItem'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device', to_model='dcim.InventoryItem'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='console_port_template_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.ConsolePortTemplate'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device_type', to_model='dcim.ConsolePortTemplate'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='console_server_port_template_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.ConsoleServerPortTemplate'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device_type', to_model='dcim.ConsoleServerPortTemplate'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='power_port_template_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.PowerPortTemplate'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device_type', to_model='dcim.PowerPortTemplate'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='power_outlet_template_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.PowerOutletTemplate'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device_type', to_model='dcim.PowerOutletTemplate'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='interface_template_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.InterfaceTemplate'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device_type', to_model='dcim.InterfaceTemplate'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='front_port_template_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.FrontPortTemplate'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device_type', to_model='dcim.FrontPortTemplate'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='rear_port_template_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.RearPortTemplate'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device_type', to_model='dcim.RearPortTemplate'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='device_bay_template_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.DeviceBayTemplate'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device_type', to_model='dcim.DeviceBayTemplate'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='module_bay_template_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.ModuleBayTemplate'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device_type', to_model='dcim.ModuleBayTemplate'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devicetype',
|
||||
name='inventory_item_template_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='device_type', to_model='dcim.InventoryItemTemplate'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='device_type', to_model='dcim.InventoryItemTemplate'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='virtualchassis',
|
||||
name='member_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='virtual_chassis', to_model='dcim.Device'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='virtual_chassis', to_model='dcim.Device'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='interfacetemplate',
|
||||
@ -241,7 +326,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='powerfeed',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='power_feeds', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='power_feeds',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='device',
|
||||
|
@ -5,7 +5,6 @@ import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0183_devicetype_exclude_from_utilization'),
|
||||
]
|
||||
@ -14,6 +13,12 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='interface',
|
||||
name='parent',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.RESTRICT, related_name='child_interfaces', to='dcim.interface'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.RESTRICT,
|
||||
related_name='child_interfaces',
|
||||
to='dcim.interface',
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0184_protect_child_interfaces'),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0185_gfk_indexes'),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0186_location_facility'),
|
||||
]
|
||||
|
@ -9,7 +9,6 @@ import utilities.ordering
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0118_customfield_uniqueness'),
|
||||
('dcim', '0187_alter_device_vc_position'),
|
||||
@ -22,36 +21,41 @@ class Migration(migrations.Migration):
|
||||
('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
|
||||
)),
|
||||
(
|
||||
'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)),
|
||||
('weight', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True)),
|
||||
('weight_unit', models.CharField(blank=True, max_length=50)),
|
||||
('_abs_weight', models.PositiveBigIntegerField(blank=True, null=True)),
|
||||
('manufacturer', models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='rack_types',
|
||||
to='dcim.manufacturer'
|
||||
)),
|
||||
(
|
||||
'manufacturer',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='rack_types', to='dcim.manufacturer'
|
||||
),
|
||||
),
|
||||
('model', models.CharField(max_length=100)),
|
||||
('slug', models.SlugField(max_length=100, unique=True)),
|
||||
('form_factor', models.CharField(max_length=50)),
|
||||
('width', models.PositiveSmallIntegerField(default=19)),
|
||||
('u_height', models.PositiveSmallIntegerField(
|
||||
default=42,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(100),
|
||||
]
|
||||
)),
|
||||
('starting_unit', models.PositiveSmallIntegerField(
|
||||
default=1,
|
||||
validators=[django.core.validators.MinValueValidator(1)]
|
||||
)),
|
||||
(
|
||||
'u_height',
|
||||
models.PositiveSmallIntegerField(
|
||||
default=42,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(100),
|
||||
],
|
||||
),
|
||||
),
|
||||
(
|
||||
'starting_unit',
|
||||
models.PositiveSmallIntegerField(
|
||||
default=1, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
('desc_units', models.BooleanField(default=False)),
|
||||
('outer_width', models.PositiveSmallIntegerField(blank=True, null=True)),
|
||||
('outer_depth', models.PositiveSmallIntegerField(blank=True, null=True)),
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0188_racktype'),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0189_moduletype_rack_airflow'),
|
||||
('extras', '0121_customfield_related_object_filter'),
|
||||
@ -34,12 +33,25 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='modulebay',
|
||||
name='module',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.module'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.module',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='modulebay',
|
||||
name='parent',
|
||||
field=mptt.fields.TreeForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='dcim.modulebay'),
|
||||
field=mptt.fields.TreeForeignKey(
|
||||
blank=True,
|
||||
editable=False,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='children',
|
||||
to='dcim.modulebay',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='modulebay',
|
||||
@ -56,19 +68,35 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='modulebaytemplate',
|
||||
name='module_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.moduletype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.moduletype',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='modulebaytemplate',
|
||||
name='device_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)ss', to='dcim.devicetype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(class)ss',
|
||||
to='dcim.devicetype',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='modulebay',
|
||||
constraint=models.UniqueConstraint(fields=('device', 'module', 'name'), name='dcim_modulebay_unique_device_module_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('device', 'module', 'name'), name='dcim_modulebay_unique_device_module_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='modulebaytemplate',
|
||||
constraint=models.UniqueConstraint(fields=('module_type', 'name'), name='dcim_modulebaytemplate_unique_module_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('module_type', 'name'), name='dcim_modulebaytemplate_unique_module_type_name'
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -13,14 +13,10 @@ def rebuild_mptt(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0190_nested_modules'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
code=rebuild_mptt,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=rebuild_mptt, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0191_module_bay_rebuild'),
|
||||
]
|
||||
|
@ -5,7 +5,6 @@ from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0192_inventoryitem_status'),
|
||||
]
|
||||
|
@ -69,7 +69,6 @@ def set_null_values(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0193_poweroutlet_color'),
|
||||
]
|
||||
@ -280,8 +279,5 @@ class Migration(migrations.Migration):
|
||||
name='cable_end',
|
||||
field=models.CharField(blank=True, max_length=1, null=True),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=set_null_values,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=set_null_values, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0194_charfield_null_choices'),
|
||||
('ipam', '0074_vlantranslationpolicy_vlantranslationrule'),
|
||||
@ -15,6 +14,8 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='vlan_translation_policy',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='ipam.vlantranslationpolicy'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='ipam.vlantranslationpolicy'
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0195_interface_vlan_translation_policy'),
|
||||
('ipam', '0075_vlan_qinq'),
|
||||
@ -13,7 +12,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='interface',
|
||||
name='qinq_svlan',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)ss_svlan', to='ipam.vlan'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='%(class)ss_svlan',
|
||||
to='ipam.vlan',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='interface',
|
||||
@ -23,6 +28,12 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='interface',
|
||||
name='untagged_vlan',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)ss_as_untagged', to='ipam.vlan'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='%(class)ss_as_untagged',
|
||||
to='ipam.vlan',
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -3,15 +3,14 @@ from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0196_qinq_svlan'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
CreateCollation(
|
||||
"natural_sort",
|
||||
provider="icu",
|
||||
locale="und-u-kn-true",
|
||||
'natural_sort',
|
||||
provider='icu',
|
||||
locale='und-u-kn-true',
|
||||
),
|
||||
]
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0197_natural_sort_collation'),
|
||||
]
|
||||
|
@ -7,7 +7,6 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0198_natural_ordering'),
|
||||
('extras', '0122_charfield_null_choices'),
|
||||
@ -20,17 +19,33 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
(
|
||||
'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)),
|
||||
('mac_address', dcim.fields.MACAddressField()),
|
||||
('assigned_object_id', models.PositiveBigIntegerField(blank=True, null=True)),
|
||||
('assigned_object_type', models.ForeignKey(blank=True, limit_choices_to=models.Q(models.Q(models.Q(('app_label', 'dcim'), ('model', 'interface')), models.Q(('app_label', 'virtualization'), ('model', 'vminterface')), _connector='OR')), null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype')),
|
||||
(
|
||||
'assigned_object_type',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
limit_choices_to=models.Q(
|
||||
models.Q(
|
||||
models.Q(('app_label', 'dcim'), ('model', 'interface')),
|
||||
models.Q(('app_label', 'virtualization'), ('model', 'vminterface')),
|
||||
_connector='OR',
|
||||
)
|
||||
),
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
'ordering': ('mac_address',)
|
||||
},
|
||||
options={'abstract': False, 'ordering': ('mac_address',)},
|
||||
),
|
||||
]
|
||||
|
@ -10,9 +10,7 @@ def populate_mac_addresses(apps, schema_editor):
|
||||
|
||||
mac_addresses = [
|
||||
MACAddress(
|
||||
mac_address=interface.mac_address,
|
||||
assigned_object_type=interface_ct,
|
||||
assigned_object_id=interface.pk
|
||||
mac_address=interface.mac_address, assigned_object_type=interface_ct, assigned_object_id=interface.pk
|
||||
)
|
||||
for interface in Interface.objects.filter(mac_address__isnull=False)
|
||||
]
|
||||
@ -24,7 +22,6 @@ def populate_mac_addresses(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0199_macaddress'),
|
||||
]
|
||||
@ -38,13 +35,10 @@ class Migration(migrations.Migration):
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='dcim.macaddress'
|
||||
to='dcim.macaddress',
|
||||
),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=populate_mac_addresses,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=populate_mac_addresses, reverse_code=migrations.RunPython.noop),
|
||||
migrations.RemoveField(
|
||||
model_name='interface',
|
||||
name='mac_address',
|
||||
|
@ -9,7 +9,6 @@ import utilities.validators
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
@ -99,8 +98,22 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('object_id', models.IntegerField(db_index=True)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_tagged_items', to='contenttypes.contenttype')),
|
||||
('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_items', to='extras.tag')),
|
||||
(
|
||||
'content_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(app_label)s_%(class)s_tagged_items',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
(
|
||||
'tag',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='%(app_label)s_%(class)s_items',
|
||||
to='extras.tag',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@ -116,9 +129,32 @@ class Migration(migrations.Migration):
|
||||
('object_repr', models.CharField(editable=False, max_length=200)),
|
||||
('prechange_data', models.JSONField(blank=True, editable=False, null=True)),
|
||||
('postchange_data', models.JSONField(blank=True, editable=False, null=True)),
|
||||
('changed_object_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype')),
|
||||
('related_object_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype')),
|
||||
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='changes', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'changed_object_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype'
|
||||
),
|
||||
),
|
||||
(
|
||||
'related_object_type',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
(
|
||||
'user',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='changes',
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-time'],
|
||||
@ -133,8 +169,16 @@ class Migration(migrations.Migration):
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('kind', models.CharField(default='info', max_length=30)),
|
||||
('comments', models.TextField()),
|
||||
('assigned_object_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
|
||||
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'assigned_object_type',
|
||||
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'),
|
||||
),
|
||||
(
|
||||
'created_by',
|
||||
models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'journal entries',
|
||||
@ -151,8 +195,24 @@ class Migration(migrations.Migration):
|
||||
('status', models.CharField(default='pending', max_length=30)),
|
||||
('data', models.JSONField(blank=True, null=True)),
|
||||
('job_id', models.UUIDField(unique=True)),
|
||||
('obj_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='job_results', to='contenttypes.contenttype')),
|
||||
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'obj_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='job_results',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
(
|
||||
'user',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ['obj_type', 'name', '-created'],
|
||||
@ -163,12 +223,20 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('object_id', models.PositiveIntegerField()),
|
||||
('image', models.ImageField(height_field='image_height', upload_to=extras.utils.image_upload, width_field='image_width')),
|
||||
(
|
||||
'image',
|
||||
models.ImageField(
|
||||
height_field='image_height', upload_to=extras.utils.image_upload, width_field='image_width'
|
||||
),
|
||||
),
|
||||
('image_height', models.PositiveSmallIntegerField()),
|
||||
('image_width', models.PositiveSmallIntegerField()),
|
||||
('name', models.CharField(blank=True, max_length=50)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
|
||||
(
|
||||
'content_type',
|
||||
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('name', 'pk'),
|
||||
@ -184,7 +252,10 @@ class Migration(migrations.Migration):
|
||||
('mime_type', models.CharField(blank=True, max_length=50)),
|
||||
('file_extension', models.CharField(blank=True, max_length=15)),
|
||||
('as_attachment', models.BooleanField(default=True)),
|
||||
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
|
||||
(
|
||||
'content_type',
|
||||
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ['content_type', 'name'],
|
||||
@ -201,7 +272,10 @@ class Migration(migrations.Migration):
|
||||
('group_name', models.CharField(blank=True, max_length=50)),
|
||||
('button_class', models.CharField(default='default', max_length=30)),
|
||||
('new_window', models.BooleanField(default=False)),
|
||||
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
|
||||
(
|
||||
'content_type',
|
||||
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ['group_name', 'weight', 'name'],
|
||||
@ -221,8 +295,16 @@ class Migration(migrations.Migration):
|
||||
('weight', models.PositiveSmallIntegerField(default=100)),
|
||||
('validation_minimum', models.PositiveIntegerField(blank=True, null=True)),
|
||||
('validation_maximum', models.PositiveIntegerField(blank=True, null=True)),
|
||||
('validation_regex', models.CharField(blank=True, max_length=500, validators=[utilities.validators.validate_regex])),
|
||||
('choices', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), blank=True, null=True, size=None)),
|
||||
(
|
||||
'validation_regex',
|
||||
models.CharField(blank=True, max_length=500, validators=[utilities.validators.validate_regex]),
|
||||
),
|
||||
(
|
||||
'choices',
|
||||
django.contrib.postgres.fields.ArrayField(
|
||||
base_field=models.CharField(max_length=100), blank=True, null=True, size=None
|
||||
),
|
||||
),
|
||||
('content_types', models.ManyToManyField(related_name='custom_fields', to='contenttypes.ContentType')),
|
||||
],
|
||||
options={
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0002_auto_20160622_1821'),
|
||||
('extras', '0001_initial'),
|
||||
|
@ -12,7 +12,6 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('extras', '0060_customlink_button_class'),
|
||||
('extras', '0061_extras_change_logging'),
|
||||
@ -40,7 +39,7 @@ class Migration(migrations.Migration):
|
||||
('extras', '0083_search'),
|
||||
('extras', '0084_staging'),
|
||||
('extras', '0085_synced_data'),
|
||||
('extras', '0086_configtemplate')
|
||||
('extras', '0086_configtemplate'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -114,7 +113,23 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='customfield',
|
||||
name='name',
|
||||
field=models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator(flags=re.RegexFlag['IGNORECASE'], message='Only alphanumeric characters and underscores are allowed.', regex='^[a-z0-9_]+$'), django.core.validators.RegexValidator(flags=re.RegexFlag['IGNORECASE'], inverse_match=True, message='Double underscores are not permitted in custom field names.', regex='__')]),
|
||||
field=models.CharField(
|
||||
max_length=50,
|
||||
unique=True,
|
||||
validators=[
|
||||
django.core.validators.RegexValidator(
|
||||
flags=re.RegexFlag['IGNORECASE'],
|
||||
message='Only alphanumeric characters and underscores are allowed.',
|
||||
regex='^[a-z0-9_]+$',
|
||||
),
|
||||
django.core.validators.RegexValidator(
|
||||
flags=re.RegexFlag['IGNORECASE'],
|
||||
inverse_match=True,
|
||||
message='Double underscores are not permitted in custom field names.',
|
||||
regex='__',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='customfield',
|
||||
@ -134,7 +149,9 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='customfield',
|
||||
name='object_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='contenttypes.contenttype'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='customlink',
|
||||
@ -314,11 +331,16 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='exporttemplate',
|
||||
constraint=models.UniqueConstraint(fields=('content_type', 'name'), name='extras_exporttemplate_unique_content_type_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('content_type', 'name'), name='extras_exporttemplate_unique_content_type_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='webhook',
|
||||
constraint=models.UniqueConstraint(fields=('payload_url', 'type_create', 'type_update', 'type_delete'), name='extras_webhook_unique_payload_url_types'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('payload_url', 'type_create', 'type_update', 'type_delete'),
|
||||
name='extras_webhook_unique_payload_url_types',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='jobresult',
|
||||
@ -328,7 +350,9 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='jobresult',
|
||||
name='interval',
|
||||
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]),
|
||||
field=models.PositiveIntegerField(
|
||||
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='jobresult',
|
||||
@ -379,7 +403,12 @@ class Migration(migrations.Migration):
|
||||
('shared', models.BooleanField(default=True)),
|
||||
('parameters', models.JSONField()),
|
||||
('content_types', models.ManyToManyField(related_name='saved_filters', to='contenttypes.contenttype')),
|
||||
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'user',
|
||||
models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('weight', 'name'),
|
||||
@ -400,7 +429,12 @@ class Migration(migrations.Migration):
|
||||
('type', models.CharField(max_length=30)),
|
||||
('value', extras.fields.CachedValueField()),
|
||||
('weight', models.PositiveSmallIntegerField(default=1000)),
|
||||
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype')),
|
||||
(
|
||||
'object_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype'
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('weight', 'object_type', 'object_id'),
|
||||
@ -414,7 +448,12 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'user',
|
||||
models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('name',),
|
||||
@ -429,8 +468,18 @@ class Migration(migrations.Migration):
|
||||
('action', models.CharField(max_length=20)),
|
||||
('object_id', models.PositiveBigIntegerField(blank=True, null=True)),
|
||||
('data', models.JSONField(blank=True, null=True)),
|
||||
('branch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='staged_changes', to='extras.branch')),
|
||||
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype')),
|
||||
(
|
||||
'branch',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='staged_changes', to='extras.branch'
|
||||
),
|
||||
),
|
||||
(
|
||||
'object_type',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype'
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('pk',),
|
||||
@ -439,7 +488,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='configcontext',
|
||||
name='data_file',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.datafile'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='core.datafile',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='configcontext',
|
||||
@ -449,7 +504,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='configcontext',
|
||||
name='data_source',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='core.datasource'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='core.datasource',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='configcontext',
|
||||
@ -464,7 +525,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='exporttemplate',
|
||||
name='data_file',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.datafile'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='core.datafile',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='exporttemplate',
|
||||
@ -474,7 +541,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='exporttemplate',
|
||||
name='data_source',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='core.datasource'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='core.datasource',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='exporttemplate',
|
||||
@ -498,8 +571,26 @@ class Migration(migrations.Migration):
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('template_code', models.TextField()),
|
||||
('environment_params', models.JSONField(blank=True, default=dict, null=True)),
|
||||
('data_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.datafile')),
|
||||
('data_source', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='core.datasource')),
|
||||
(
|
||||
'data_file',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='core.datafile',
|
||||
),
|
||||
),
|
||||
(
|
||||
'data_source',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='core.datasource',
|
||||
),
|
||||
),
|
||||
('auto_sync_enabled', models.BooleanField(default=False)),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
|
@ -9,7 +9,6 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('extras', '0087_dashboard'),
|
||||
('extras', '0088_jobresult_webhooks'),
|
||||
@ -22,7 +21,7 @@ class Migration(migrations.Migration):
|
||||
('extras', '0095_bookmarks'),
|
||||
('extras', '0096_customfieldchoiceset'),
|
||||
('extras', '0097_customfield_remove_choices'),
|
||||
('extras', '0098_webhook_custom_field_data_webhook_tags')
|
||||
('extras', '0098_webhook_custom_field_data_webhook_tags'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -39,7 +38,14 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('layout', models.JSONField(default=list)),
|
||||
('config', models.JSONField(default=dict)),
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='dashboard', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'user',
|
||||
models.OneToOneField(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='dashboard',
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
@ -64,8 +70,7 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ReportModule',
|
||||
fields=[
|
||||
],
|
||||
fields=[],
|
||||
options={
|
||||
'proxy': True,
|
||||
'ordering': ('file_root', 'file_path'),
|
||||
@ -76,8 +81,7 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ScriptModule',
|
||||
fields=[
|
||||
],
|
||||
fields=[],
|
||||
options={
|
||||
'proxy': True,
|
||||
'ordering': ('file_root', 'file_path'),
|
||||
@ -108,7 +112,10 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('object_id', models.PositiveBigIntegerField()),
|
||||
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='contenttypes.contenttype')),
|
||||
(
|
||||
'object_type',
|
||||
models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='contenttypes.contenttype'),
|
||||
),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
@ -117,7 +124,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='bookmark',
|
||||
constraint=models.UniqueConstraint(fields=('object_type', 'object_id', 'user'), name='extras_bookmark_unique_per_object_and_user'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('object_type', 'object_id', 'user'), name='extras_bookmark_unique_per_object_and_user'
|
||||
),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CustomFieldChoiceSet',
|
||||
@ -128,7 +137,17 @@ class Migration(migrations.Migration):
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('base_choices', models.CharField(blank=True, max_length=50)),
|
||||
('extra_choices', django.contrib.postgres.fields.ArrayField(base_field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), size=2), blank=True, null=True, size=None)),
|
||||
(
|
||||
'extra_choices',
|
||||
django.contrib.postgres.fields.ArrayField(
|
||||
base_field=django.contrib.postgres.fields.ArrayField(
|
||||
base_field=models.CharField(max_length=100), size=2
|
||||
),
|
||||
blank=True,
|
||||
null=True,
|
||||
size=None,
|
||||
),
|
||||
),
|
||||
('order_alphabetically', models.BooleanField(default=False)),
|
||||
],
|
||||
options={
|
||||
@ -138,7 +157,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='customfield',
|
||||
name='choice_set',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='choices_for', to='extras.customfieldchoiceset'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='choices_for',
|
||||
to='extras.customfieldchoiceset',
|
||||
),
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='customfield',
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0098_webhook_custom_field_data_webhook_tags'),
|
||||
]
|
||||
|
@ -14,7 +14,6 @@ def update_ui_attrs(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0099_cachedvalue_ordering'),
|
||||
]
|
||||
@ -30,10 +29,7 @@ class Migration(migrations.Migration):
|
||||
name='ui_visible',
|
||||
field=models.CharField(default='always', max_length=50),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=update_ui_attrs,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=update_ui_attrs, reverse_code=migrations.RunPython.noop),
|
||||
migrations.RemoveField(
|
||||
model_name='customfield',
|
||||
name='ui_visibility',
|
||||
|
@ -8,8 +8,8 @@ from extras.choices import *
|
||||
|
||||
|
||||
def move_webhooks(apps, schema_editor):
|
||||
Webhook = apps.get_model("extras", "Webhook")
|
||||
EventRule = apps.get_model("extras", "EventRule")
|
||||
Webhook = apps.get_model('extras', 'Webhook')
|
||||
EventRule = apps.get_model('extras', 'EventRule')
|
||||
|
||||
webhook_ct = ContentType.objects.get_for_model(Webhook).pk
|
||||
for webhook in Webhook.objects.all():
|
||||
@ -39,7 +39,6 @@ class Migration(migrations.Migration):
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
# Create the EventRule model
|
||||
migrations.CreateModel(
|
||||
name='EventRule',
|
||||
@ -93,12 +92,12 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='eventrule',
|
||||
index=models.Index(fields=['action_object_type', 'action_object_id'], name='extras_even_action__d9e2af_idx'),
|
||||
index=models.Index(
|
||||
fields=['action_object_type', 'action_object_id'], name='extras_even_action__d9e2af_idx'
|
||||
),
|
||||
),
|
||||
|
||||
# Replicate Webhook data
|
||||
migrations.RunPython(move_webhooks),
|
||||
|
||||
# Remove obsolete fields from Webhook
|
||||
migrations.RemoveConstraint(
|
||||
model_name='webhook',
|
||||
@ -136,7 +135,6 @@ class Migration(migrations.Migration):
|
||||
model_name='webhook',
|
||||
name='type_update',
|
||||
),
|
||||
|
||||
# Add description field to Webhook
|
||||
migrations.AddField(
|
||||
model_name='webhook',
|
||||
|
@ -13,7 +13,6 @@ def update_content_type(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0101_eventrule'),
|
||||
]
|
||||
@ -32,8 +31,5 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
],
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=update_content_type,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=update_content_type, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0102_move_configrevision'),
|
||||
]
|
||||
@ -20,15 +19,21 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='journalentry',
|
||||
index=models.Index(fields=['assigned_object_type', 'assigned_object_id'], name='extras_jour_assigne_76510f_idx'),
|
||||
index=models.Index(
|
||||
fields=['assigned_object_type', 'assigned_object_id'], name='extras_jour_assigne_76510f_idx'
|
||||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='objectchange',
|
||||
index=models.Index(fields=['changed_object_type', 'changed_object_id'], name='extras_obje_changed_927fe5_idx'),
|
||||
index=models.Index(
|
||||
fields=['changed_object_type', 'changed_object_id'], name='extras_obje_changed_927fe5_idx'
|
||||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='objectchange',
|
||||
index=models.Index(fields=['related_object_type', 'related_object_id'], name='extras_obje_related_bfcdef_idx'),
|
||||
index=models.Index(
|
||||
fields=['related_object_type', 'related_object_id'], name='extras_obje_related_bfcdef_idx'
|
||||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='stagedchange',
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0104_stagedchange_remove_change_logging'),
|
||||
]
|
||||
|
@ -6,7 +6,6 @@ import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('extras', '0105_customfield_min_max_values'),
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0106_bookmark_user_cascade_deletion'),
|
||||
]
|
||||
|
@ -12,16 +12,12 @@ def convert_reportmodule_jobs(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0107_cachedvalue_extras_cachedvalue_object'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
code=convert_reportmodule_jobs,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=convert_reportmodule_jobs, reverse_code=migrations.RunPython.noop),
|
||||
migrations.DeleteModel(
|
||||
name='Report',
|
||||
),
|
||||
|
@ -55,9 +55,10 @@ def get_module_scripts(scriptmodule):
|
||||
"""
|
||||
Return a dictionary mapping of name and script class inside the passed ScriptModule.
|
||||
"""
|
||||
|
||||
def get_name(cls):
|
||||
# For child objects in submodules use the full import path w/o the root module as the name
|
||||
return cls.full_name.split(".", maxsplit=1)[1]
|
||||
return cls.full_name.split('.', maxsplit=1)[1]
|
||||
|
||||
loader = SourceFileLoader(get_python_name(scriptmodule), get_full_path(scriptmodule))
|
||||
try:
|
||||
@ -100,17 +101,13 @@ def update_scripts(apps, schema_editor):
|
||||
)
|
||||
|
||||
# Update all Jobs associated with this ScriptModule & script name to point to the new Script object
|
||||
Job.objects.filter(
|
||||
object_type_id=scriptmodule_ct.id,
|
||||
object_id=module.pk,
|
||||
name=script_name
|
||||
).update(object_type_id=script_ct.id, object_id=script.pk)
|
||||
Job.objects.filter(object_type_id=scriptmodule_ct.id, object_id=module.pk, name=script_name).update(
|
||||
object_type_id=script_ct.id, object_id=script.pk
|
||||
)
|
||||
# Update all Jobs associated with this ScriptModule & script name to point to the new Script object
|
||||
Job.objects.filter(
|
||||
object_type_id=reportmodule_ct.id,
|
||||
object_id=module.pk,
|
||||
name=script_name
|
||||
).update(object_type_id=script_ct.id, object_id=script.pk)
|
||||
Job.objects.filter(object_type_id=reportmodule_ct.id, object_id=module.pk, name=script_name).update(
|
||||
object_type_id=script_ct.id, object_id=script.pk
|
||||
)
|
||||
|
||||
|
||||
def update_event_rules(apps, schema_editor):
|
||||
@ -129,15 +126,12 @@ def update_event_rules(apps, schema_editor):
|
||||
for eventrule in EventRule.objects.filter(action_object_type=scriptmodule_ct):
|
||||
name = eventrule.action_parameters.get('script_name')
|
||||
obj, __ = Script.objects.get_or_create(
|
||||
module_id=eventrule.action_object_id,
|
||||
name=name,
|
||||
defaults={'is_executable': False}
|
||||
module_id=eventrule.action_object_id, name=name, defaults={'is_executable': False}
|
||||
)
|
||||
EventRule.objects.filter(pk=eventrule.pk).update(action_object_type=script_ct, action_object_id=obj.id)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0108_convert_reports_to_scripts'),
|
||||
]
|
||||
@ -148,8 +142,16 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(editable=False, max_length=79)),
|
||||
('module', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='scripts', to='extras.scriptmodule')),
|
||||
('is_executable', models.BooleanField(editable=False, default=True))
|
||||
(
|
||||
'module',
|
||||
models.ForeignKey(
|
||||
editable=False,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='scripts',
|
||||
to='extras.scriptmodule',
|
||||
),
|
||||
),
|
||||
('is_executable', models.BooleanField(editable=False, default=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ('module', 'name'),
|
||||
@ -159,12 +161,6 @@ class Migration(migrations.Migration):
|
||||
model_name='script',
|
||||
constraint=models.UniqueConstraint(fields=('name', 'module'), name='extras_script_unique_name_module'),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=update_scripts,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=update_event_rules,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=update_scripts, reverse_code=migrations.RunPython.noop),
|
||||
migrations.RunPython(code=update_event_rules, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0109_script_model'),
|
||||
]
|
||||
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0010_gfk_indexes'),
|
||||
('extras', '0110_remove_eventrule_action_parameters'),
|
||||
@ -24,16 +23,17 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='customfield',
|
||||
name='object_type',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='core.objecttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='core.objecttype'
|
||||
),
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE IF EXISTS extras_customfield_content_types_id_seq RENAME TO extras_customfield_object_types_id_seq"
|
||||
'ALTER TABLE IF EXISTS extras_customfield_content_types_id_seq RENAME TO extras_customfield_object_types_id_seq'
|
||||
),
|
||||
# Pre-v2.10 sequence name (see #15605)
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE IF EXISTS extras_customfield_obj_type_id_seq RENAME TO extras_customfield_object_types_id_seq"
|
||||
'ALTER TABLE IF EXISTS extras_customfield_obj_type_id_seq RENAME TO extras_customfield_object_types_id_seq'
|
||||
),
|
||||
|
||||
# Custom links
|
||||
migrations.RenameField(
|
||||
model_name='customlink',
|
||||
@ -46,9 +46,8 @@ class Migration(migrations.Migration):
|
||||
field=models.ManyToManyField(related_name='custom_links', to='core.objecttype'),
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE extras_customlink_content_types_id_seq RENAME TO extras_customlink_object_types_id_seq"
|
||||
'ALTER TABLE extras_customlink_content_types_id_seq RENAME TO extras_customlink_object_types_id_seq'
|
||||
),
|
||||
|
||||
# Event rules
|
||||
migrations.RenameField(
|
||||
model_name='eventrule',
|
||||
@ -61,9 +60,8 @@ class Migration(migrations.Migration):
|
||||
field=models.ManyToManyField(related_name='event_rules', to='core.objecttype'),
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE extras_eventrule_content_types_id_seq RENAME TO extras_eventrule_object_types_id_seq"
|
||||
'ALTER TABLE extras_eventrule_content_types_id_seq RENAME TO extras_eventrule_object_types_id_seq'
|
||||
),
|
||||
|
||||
# Export templates
|
||||
migrations.RenameField(
|
||||
model_name='exporttemplate',
|
||||
@ -76,9 +74,8 @@ class Migration(migrations.Migration):
|
||||
field=models.ManyToManyField(related_name='export_templates', to='core.objecttype'),
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE extras_exporttemplate_content_types_id_seq RENAME TO extras_exporttemplate_object_types_id_seq"
|
||||
'ALTER TABLE extras_exporttemplate_content_types_id_seq RENAME TO extras_exporttemplate_object_types_id_seq'
|
||||
),
|
||||
|
||||
# Saved filters
|
||||
migrations.RenameField(
|
||||
model_name='savedfilter',
|
||||
@ -91,9 +88,8 @@ class Migration(migrations.Migration):
|
||||
field=models.ManyToManyField(related_name='saved_filters', to='core.objecttype'),
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE extras_savedfilter_content_types_id_seq RENAME TO extras_savedfilter_object_types_id_seq"
|
||||
'ALTER TABLE extras_savedfilter_content_types_id_seq RENAME TO extras_savedfilter_object_types_id_seq'
|
||||
),
|
||||
|
||||
# Image attachments
|
||||
migrations.RemoveIndex(
|
||||
model_name='imageattachment',
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0010_gfk_indexes'),
|
||||
('extras', '0111_rename_content_types'),
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0112_tag_update_object_types'),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0113_customfield_rename_object_type'),
|
||||
]
|
||||
|
@ -16,14 +16,10 @@ def update_dashboard_widgets(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0114_customfield_add_comments'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
code=update_dashboard_widgets,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=update_dashboard_widgets, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -7,7 +7,6 @@ def update_link_buttons(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0115_convert_dashboard_widgets'),
|
||||
]
|
||||
@ -18,8 +17,5 @@ class Migration(migrations.Migration):
|
||||
name='button_class',
|
||||
field=models.CharField(default='default', max_length=30),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=update_link_buttons,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=update_link_buttons, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -26,7 +26,6 @@ def update_dashboard_widgets(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0116_custom_link_button_color'),
|
||||
('core', '0011_move_objectchange'),
|
||||
@ -44,81 +43,64 @@ class Migration(migrations.Migration):
|
||||
name='ObjectChange',
|
||||
table='core_objectchange',
|
||||
),
|
||||
|
||||
# Rename PK sequence
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE extras_objectchange_id_seq"
|
||||
" RENAME TO core_objectchange_id_seq"
|
||||
),
|
||||
|
||||
migrations.RunSQL('ALTER TABLE extras_objectchange_id_seq' ' RENAME TO core_objectchange_id_seq'),
|
||||
# Rename indexes. Hashes generated by schema_editor._create_index_name()
|
||||
migrations.RunSQL('ALTER INDEX extras_objectchange_pkey' ' RENAME TO core_objectchange_pkey'),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX extras_objectchange_pkey"
|
||||
" RENAME TO core_objectchange_pkey"
|
||||
'ALTER INDEX extras_obje_changed_927fe5_idx'
|
||||
' RENAME TO core_objectchange_changed_object_type_id_cha_79a9ed1e'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX extras_obje_changed_927fe5_idx"
|
||||
" RENAME TO core_objectchange_changed_object_type_id_cha_79a9ed1e"
|
||||
'ALTER INDEX extras_obje_related_bfcdef_idx'
|
||||
' RENAME TO core_objectchange_related_object_type_id_rel_a71d604a'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX extras_obje_related_bfcdef_idx"
|
||||
" RENAME TO core_objectchange_related_object_type_id_rel_a71d604a"
|
||||
'ALTER INDEX extras_objectchange_changed_object_type_id_b755bb60'
|
||||
' RENAME TO core_objectchange_changed_object_type_id_2070ade6'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX extras_objectchange_changed_object_type_id_b755bb60"
|
||||
" RENAME TO core_objectchange_changed_object_type_id_2070ade6"
|
||||
'ALTER INDEX extras_objectchange_related_object_type_id_fe6e521f'
|
||||
' RENAME TO core_objectchange_related_object_type_id_b80958af'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX extras_objectchange_related_object_type_id_fe6e521f"
|
||||
" RENAME TO core_objectchange_related_object_type_id_b80958af"
|
||||
'ALTER INDEX extras_objectchange_request_id_4ae21e90'
|
||||
' RENAME TO core_objectchange_request_id_d9d160ac'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX extras_objectchange_request_id_4ae21e90"
|
||||
" RENAME TO core_objectchange_request_id_d9d160ac"
|
||||
'ALTER INDEX extras_objectchange_time_224380ea' ' RENAME TO core_objectchange_time_800f60a5'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX extras_objectchange_time_224380ea"
|
||||
" RENAME TO core_objectchange_time_800f60a5"
|
||||
'ALTER INDEX extras_objectchange_user_id_7fdf8186' ' RENAME TO core_objectchange_user_id_2b2142be'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX extras_objectchange_user_id_7fdf8186"
|
||||
" RENAME TO core_objectchange_user_id_2b2142be"
|
||||
),
|
||||
|
||||
# Rename constraints
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE core_objectchange RENAME CONSTRAINT "
|
||||
"extras_objectchange_changed_object_id_check TO "
|
||||
"core_objectchange_changed_object_id_check"
|
||||
'ALTER TABLE core_objectchange RENAME CONSTRAINT '
|
||||
'extras_objectchange_changed_object_id_check TO '
|
||||
'core_objectchange_changed_object_id_check'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE core_objectchange RENAME CONSTRAINT "
|
||||
"extras_objectchange_related_object_id_check TO "
|
||||
"core_objectchange_related_object_id_check"
|
||||
'ALTER TABLE core_objectchange RENAME CONSTRAINT '
|
||||
'extras_objectchange_related_object_id_check TO '
|
||||
'core_objectchange_related_object_id_check'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE core_objectchange RENAME CONSTRAINT "
|
||||
"extras_objectchange_changed_object_type__b755bb60_fk_django_co TO "
|
||||
"core_objectchange_changed_object_type_id_2070ade6"
|
||||
'ALTER TABLE core_objectchange RENAME CONSTRAINT '
|
||||
'extras_objectchange_changed_object_type__b755bb60_fk_django_co TO '
|
||||
'core_objectchange_changed_object_type_id_2070ade6'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE core_objectchange RENAME CONSTRAINT "
|
||||
"extras_objectchange_related_object_type__fe6e521f_fk_django_co TO "
|
||||
"core_objectchange_related_object_type_id_b80958af"
|
||||
'ALTER TABLE core_objectchange RENAME CONSTRAINT '
|
||||
'extras_objectchange_related_object_type__fe6e521f_fk_django_co TO '
|
||||
'core_objectchange_related_object_type_id_b80958af'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE core_objectchange RENAME CONSTRAINT "
|
||||
"extras_objectchange_user_id_7fdf8186_fk_auth_user_id TO "
|
||||
"core_objectchange_user_id_2b2142be"
|
||||
'ALTER TABLE core_objectchange RENAME CONSTRAINT '
|
||||
'extras_objectchange_user_id_7fdf8186_fk_auth_user_id TO '
|
||||
'core_objectchange_user_id_2b2142be'
|
||||
),
|
||||
],
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=update_content_types,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=update_dashboard_widgets,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=update_content_types, reverse_code=migrations.RunPython.noop),
|
||||
migrations.RunPython(code=update_dashboard_widgets, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0117_move_objectchange'),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
('extras', '0118_customfield_uniqueness'),
|
||||
@ -22,7 +21,10 @@ class Migration(migrations.Migration):
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('groups', models.ManyToManyField(blank=True, related_name='notification_groups', to='users.group')),
|
||||
('users', models.ManyToManyField(blank=True, related_name='notification_groups', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'users',
|
||||
models.ManyToManyField(blank=True, related_name='notification_groups', to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'notification group',
|
||||
@ -36,8 +38,18 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('object_id', models.PositiveBigIntegerField()),
|
||||
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='contenttypes.contenttype')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subscriptions', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'object_type',
|
||||
models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='contenttypes.contenttype'),
|
||||
),
|
||||
(
|
||||
'user',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='subscriptions',
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'subscription',
|
||||
@ -53,9 +65,19 @@ class Migration(migrations.Migration):
|
||||
('read', models.DateTimeField(blank=True, null=True)),
|
||||
('object_id', models.PositiveBigIntegerField()),
|
||||
('event_type', models.CharField(max_length=50)),
|
||||
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='contenttypes.contenttype')),
|
||||
(
|
||||
'object_type',
|
||||
models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='contenttypes.contenttype'),
|
||||
),
|
||||
('object_repr', models.CharField(editable=False, max_length=200)),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'user',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='notifications',
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'notification',
|
||||
@ -66,7 +88,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='notification',
|
||||
constraint=models.UniqueConstraint(fields=('object_type', 'object_id', 'user'), name='extras_notification_unique_per_object_and_user'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('object_type', 'object_id', 'user'), name='extras_notification_unique_per_object_and_user'
|
||||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='subscription',
|
||||
@ -74,6 +98,8 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='subscription',
|
||||
constraint=models.UniqueConstraint(fields=('object_type', 'object_id', 'user'), name='extras_subscription_unique_per_object_and_user'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('object_type', 'object_id', 'user'), name='extras_subscription_unique_per_object_and_user'
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -26,7 +26,6 @@ def set_event_types(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0119_notifications'),
|
||||
]
|
||||
@ -36,16 +35,10 @@ class Migration(migrations.Migration):
|
||||
model_name='eventrule',
|
||||
name='event_types',
|
||||
field=django.contrib.postgres.fields.ArrayField(
|
||||
base_field=models.CharField(max_length=50),
|
||||
blank=True,
|
||||
null=True,
|
||||
size=None
|
||||
base_field=models.CharField(max_length=50), blank=True, null=True, size=None
|
||||
),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=set_event_types,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=set_event_types, reverse_code=migrations.RunPython.noop),
|
||||
migrations.AlterField(
|
||||
model_name='eventrule',
|
||||
name='event_types',
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0120_eventrule_event_types'),
|
||||
]
|
||||
|
@ -11,7 +11,6 @@ def set_null_values(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0121_customfield_related_object_filter'),
|
||||
]
|
||||
@ -22,8 +21,5 @@ class Migration(migrations.Migration):
|
||||
name='base_choices',
|
||||
field=models.CharField(blank=True, max_length=50, null=True),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=set_null_values,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=set_null_values, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -9,7 +9,6 @@ import taggit.managers
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
@ -50,7 +49,20 @@ class Migration(migrations.Migration):
|
||||
('status', models.CharField(default='active', max_length=50)),
|
||||
('role', models.CharField(blank=True, max_length=50)),
|
||||
('assigned_object_id', models.PositiveIntegerField(blank=True, null=True)),
|
||||
('dns_name', models.CharField(blank=True, max_length=255, validators=[django.core.validators.RegexValidator(code='invalid', message='Only alphanumeric characters, asterisks, hyphens, periods, and underscores are allowed in DNS names', regex='^([0-9A-Za-z_-]+|\\*)(\\.[0-9A-Za-z_-]+)*\\.?$')])),
|
||||
(
|
||||
'dns_name',
|
||||
models.CharField(
|
||||
blank=True,
|
||||
max_length=255,
|
||||
validators=[
|
||||
django.core.validators.RegexValidator(
|
||||
code='invalid',
|
||||
message='Only alphanumeric characters, asterisks, hyphens, periods, and underscores are allowed in DNS names',
|
||||
regex='^([0-9A-Za-z_-]+|\\*)(\\.[0-9A-Za-z_-]+)*\\.?$',
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
],
|
||||
options={
|
||||
@ -73,7 +85,11 @@ class Migration(migrations.Migration):
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'prefixes',
|
||||
'ordering': (django.db.models.expressions.OrderBy(django.db.models.expressions.F('vrf'), nulls_first=True), 'prefix', 'pk'),
|
||||
'ordering': (
|
||||
django.db.models.expressions.OrderBy(django.db.models.expressions.F('vrf'), nulls_first=True),
|
||||
'prefix',
|
||||
'pk',
|
||||
),
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@ -135,10 +151,25 @@ class Migration(migrations.Migration):
|
||||
('rd', models.CharField(blank=True, max_length=21, null=True, unique=True)),
|
||||
('enforce_unique', models.BooleanField(default=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('export_targets', models.ManyToManyField(blank=True, related_name='exporting_vrfs', to='ipam.RouteTarget')),
|
||||
('import_targets', models.ManyToManyField(blank=True, related_name='importing_vrfs', to='ipam.RouteTarget')),
|
||||
(
|
||||
'export_targets',
|
||||
models.ManyToManyField(blank=True, related_name='exporting_vrfs', to='ipam.RouteTarget'),
|
||||
),
|
||||
(
|
||||
'import_targets',
|
||||
models.ManyToManyField(blank=True, related_name='importing_vrfs', to='ipam.RouteTarget'),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vrfs', to='tenancy.tenant')),
|
||||
(
|
||||
'tenant',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='vrfs',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'VRF',
|
||||
@ -157,7 +188,21 @@ class Migration(migrations.Migration):
|
||||
('slug', models.SlugField(max_length=100)),
|
||||
('scope_id', models.PositiveBigIntegerField(blank=True, null=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('scope_type', models.ForeignKey(blank=True, limit_choices_to=models.Q(('model__in', ('region', 'sitegroup', 'site', 'location', 'rack', 'clustergroup', 'cluster'))), null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
|
||||
(
|
||||
'scope_type',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
limit_choices_to=models.Q(
|
||||
(
|
||||
'model__in',
|
||||
('region', 'sitegroup', 'site', 'location', 'rack', 'clustergroup', 'cluster'),
|
||||
)
|
||||
),
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'VLAN group',
|
||||
@ -172,15 +217,59 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
('vid', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(4094)])),
|
||||
(
|
||||
'vid',
|
||||
models.PositiveSmallIntegerField(
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(4094),
|
||||
]
|
||||
),
|
||||
),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('status', models.CharField(default='active', max_length=50)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vlans', to='ipam.vlangroup')),
|
||||
('role', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vlans', to='ipam.role')),
|
||||
('site', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vlans', to='dcim.site')),
|
||||
(
|
||||
'group',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='vlans',
|
||||
to='ipam.vlangroup',
|
||||
),
|
||||
),
|
||||
(
|
||||
'role',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='vlans',
|
||||
to='ipam.role',
|
||||
),
|
||||
),
|
||||
(
|
||||
'site',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='vlans',
|
||||
to='dcim.site',
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vlans', to='tenancy.tenant')),
|
||||
(
|
||||
'tenant',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='vlans',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'VLAN',
|
||||
@ -197,9 +286,29 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('protocol', models.CharField(max_length=50)),
|
||||
('ports', django.contrib.postgres.fields.ArrayField(base_field=models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65535)]), size=None)),
|
||||
(
|
||||
'ports',
|
||||
django.contrib.postgres.fields.ArrayField(
|
||||
base_field=models.PositiveIntegerField(
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(65535),
|
||||
]
|
||||
),
|
||||
size=None,
|
||||
),
|
||||
),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('device', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='services', to='dcim.device')),
|
||||
(
|
||||
'device',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='services',
|
||||
to='dcim.device',
|
||||
),
|
||||
),
|
||||
('ipaddresses', models.ManyToManyField(blank=True, related_name='services', to='ipam.IPAddress')),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
|
@ -4,7 +4,6 @@ import taggit.managers
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0003_auto_20160628_1721'),
|
||||
('virtualization', '0001_virtualization'),
|
||||
@ -66,7 +65,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='service',
|
||||
name='virtual_machine',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='services', to='virtualization.virtualmachine'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='services',
|
||||
to='virtualization.virtualmachine',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='routetarget',
|
||||
@ -76,17 +81,35 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='routetarget',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='route_targets', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='route_targets',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='prefix',
|
||||
name='role',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='prefixes', to='ipam.role'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='prefixes',
|
||||
to='ipam.role',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='prefix',
|
||||
name='site',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='prefixes', to='dcim.site'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='prefixes',
|
||||
to='dcim.site',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='prefix',
|
||||
@ -96,27 +119,64 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='prefix',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='prefixes', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='prefixes',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='prefix',
|
||||
name='vlan',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='prefixes', to='ipam.vlan'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='prefixes',
|
||||
to='ipam.vlan',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='prefix',
|
||||
name='vrf',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='prefixes', to='ipam.vrf'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='prefixes',
|
||||
to='ipam.vrf',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='ipaddress',
|
||||
name='assigned_object_type',
|
||||
field=models.ForeignKey(blank=True, limit_choices_to=models.Q(models.Q(models.Q(('app_label', 'dcim'), ('model', 'interface')), models.Q(('app_label', 'virtualization'), ('model', 'vminterface')), _connector='OR')), null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
limit_choices_to=models.Q(
|
||||
models.Q(
|
||||
models.Q(('app_label', 'dcim'), ('model', 'interface')),
|
||||
models.Q(('app_label', 'virtualization'), ('model', 'vminterface')),
|
||||
_connector='OR',
|
||||
)
|
||||
),
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='ipaddress',
|
||||
name='nat_inside',
|
||||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='nat_outside', to='ipam.ipaddress'),
|
||||
field=models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='nat_outside',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='ipaddress',
|
||||
@ -126,17 +186,31 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='ipaddress',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='ip_addresses', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='ip_addresses',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='ipaddress',
|
||||
name='vrf',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='ip_addresses', to='ipam.vrf'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='ip_addresses',
|
||||
to='ipam.vrf',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='aggregate',
|
||||
name='rir',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='aggregates', to='ipam.rir'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='aggregates', to='ipam.rir'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='aggregate',
|
||||
@ -146,7 +220,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='aggregate',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='aggregates', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='aggregates',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='vlangroup',
|
||||
|
@ -8,7 +8,6 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('ipam', '0047_prefix_depth_children'),
|
||||
('ipam', '0048_prefix_populate_depth_children'),
|
||||
@ -16,7 +15,7 @@ class Migration(migrations.Migration):
|
||||
('ipam', '0050_iprange'),
|
||||
('ipam', '0051_extend_tag_support'),
|
||||
('ipam', '0052_fhrpgroup'),
|
||||
('ipam', '0053_asn_model')
|
||||
('ipam', '0053_asn_model'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -47,17 +46,47 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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=utilities.json.CustomFieldJSONEncoder)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('start_address', ipam.fields.IPAddressField()),
|
||||
('end_address', ipam.fields.IPAddressField()),
|
||||
('size', models.PositiveIntegerField(editable=False)),
|
||||
('status', models.CharField(default='active', max_length=50)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('role', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ip_ranges', to='ipam.role')),
|
||||
(
|
||||
'role',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='ip_ranges',
|
||||
to='ipam.role',
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='ip_ranges', to='tenancy.tenant')),
|
||||
('vrf', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='ip_ranges', to='ipam.vrf')),
|
||||
(
|
||||
'tenant',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='ip_ranges',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
(
|
||||
'vrf',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='ip_ranges',
|
||||
to='ipam.vrf',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'IP range',
|
||||
@ -85,7 +114,10 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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=utilities.json.CustomFieldJSONEncoder)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('group_id', models.PositiveSmallIntegerField()),
|
||||
('protocol', models.CharField(max_length=50)),
|
||||
@ -102,7 +134,21 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='ipaddress',
|
||||
name='assigned_object_type',
|
||||
field=models.ForeignKey(blank=True, limit_choices_to=models.Q(models.Q(models.Q(('app_label', 'dcim'), ('model', 'interface')), models.Q(('app_label', 'ipam'), ('model', 'fhrpgroup')), models.Q(('app_label', 'virtualization'), ('model', 'vminterface')), _connector='OR')), null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
limit_choices_to=models.Q(
|
||||
models.Q(
|
||||
models.Q(('app_label', 'dcim'), ('model', 'interface')),
|
||||
models.Q(('app_label', 'ipam'), ('model', 'fhrpgroup')),
|
||||
models.Q(('app_label', 'virtualization'), ('model', 'vminterface')),
|
||||
_connector='OR',
|
||||
)
|
||||
),
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='FHRPGroupAssignment',
|
||||
@ -111,9 +157,20 @@ class Migration(migrations.Migration):
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('interface_id', models.PositiveIntegerField()),
|
||||
('priority', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(255)])),
|
||||
(
|
||||
'priority',
|
||||
models.PositiveSmallIntegerField(
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(0),
|
||||
django.core.validators.MaxValueValidator(255),
|
||||
]
|
||||
),
|
||||
),
|
||||
('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ipam.fhrpgroup')),
|
||||
('interface_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
|
||||
(
|
||||
'interface_type',
|
||||
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'FHRP group assignment',
|
||||
@ -126,13 +183,28 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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=utilities.json.CustomFieldJSONEncoder)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('asn', ipam.fields.ASNField(unique=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('rir', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='asns', to='ipam.rir')),
|
||||
(
|
||||
'rir',
|
||||
models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='asns', to='ipam.rir'),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='asns', to='tenancy.tenant')),
|
||||
(
|
||||
'tenant',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='asns',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'ASN',
|
||||
|
@ -10,7 +10,6 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('ipam', '0054_vlangroup_min_max_vids'),
|
||||
('ipam', '0055_servicetemplate'),
|
||||
@ -25,7 +24,7 @@ class Migration(migrations.Migration):
|
||||
('ipam', '0064_clear_search_cache'),
|
||||
('ipam', '0065_asnrange'),
|
||||
('ipam', '0066_iprange_mark_utilized'),
|
||||
('ipam', '0067_ipaddress_index_host')
|
||||
('ipam', '0067_ipaddress_index_host'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -40,12 +39,24 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='vlangroup',
|
||||
name='max_vid',
|
||||
field=models.PositiveSmallIntegerField(default=4094, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(4094)]),
|
||||
field=models.PositiveSmallIntegerField(
|
||||
default=4094,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(4094),
|
||||
],
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='vlangroup',
|
||||
name='min_vid',
|
||||
field=models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(4094)]),
|
||||
field=models.PositiveSmallIntegerField(
|
||||
default=1,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(4094),
|
||||
],
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='aggregate',
|
||||
@ -187,10 +198,24 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('protocol', models.CharField(max_length=50)),
|
||||
('ports', django.contrib.postgres.fields.ArrayField(base_field=models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65535)]), size=None)),
|
||||
(
|
||||
'ports',
|
||||
django.contrib.postgres.fields.ArrayField(
|
||||
base_field=models.PositiveIntegerField(
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(65535),
|
||||
]
|
||||
),
|
||||
size=None,
|
||||
),
|
||||
),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
@ -217,7 +242,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='ipaddress',
|
||||
name='nat_inside',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='nat_outside', to='ipam.ipaddress'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='nat_outside',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='L2VPN',
|
||||
@ -225,16 +256,34 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
(
|
||||
'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)),
|
||||
('type', models.CharField(max_length=50)),
|
||||
('identifier', models.BigIntegerField(blank=True, null=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('export_targets', models.ManyToManyField(blank=True, related_name='exporting_l2vpns', to='ipam.routetarget')),
|
||||
('import_targets', models.ManyToManyField(blank=True, related_name='importing_l2vpns', to='ipam.routetarget')),
|
||||
(
|
||||
'export_targets',
|
||||
models.ManyToManyField(blank=True, related_name='exporting_l2vpns', to='ipam.routetarget'),
|
||||
),
|
||||
(
|
||||
'import_targets',
|
||||
models.ManyToManyField(blank=True, related_name='importing_l2vpns', to='ipam.routetarget'),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='l2vpns', to='tenancy.tenant')),
|
||||
(
|
||||
'tenant',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='l2vpns',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'L2VPN',
|
||||
@ -247,10 +296,33 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('assigned_object_id', models.PositiveBigIntegerField()),
|
||||
('assigned_object_type', models.ForeignKey(limit_choices_to=models.Q(models.Q(models.Q(('app_label', 'dcim'), ('model', 'interface')), models.Q(('app_label', 'ipam'), ('model', 'vlan')), models.Q(('app_label', 'virtualization'), ('model', 'vminterface')), _connector='OR')), on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype')),
|
||||
('l2vpn', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='terminations', to='ipam.l2vpn')),
|
||||
(
|
||||
'assigned_object_type',
|
||||
models.ForeignKey(
|
||||
limit_choices_to=models.Q(
|
||||
models.Q(
|
||||
models.Q(('app_label', 'dcim'), ('model', 'interface')),
|
||||
models.Q(('app_label', 'ipam'), ('model', 'vlan')),
|
||||
models.Q(('app_label', 'virtualization'), ('model', 'vminterface')),
|
||||
_connector='OR',
|
||||
)
|
||||
),
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
(
|
||||
'l2vpn',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='terminations', to='ipam.l2vpn'
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
options={
|
||||
@ -260,7 +332,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='l2vpntermination',
|
||||
constraint=models.UniqueConstraint(fields=('assigned_object_type', 'assigned_object_id'), name='ipam_l2vpntermination_assigned_object'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('assigned_object_type', 'assigned_object_id'), name='ipam_l2vpntermination_assigned_object'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='fhrpgroup',
|
||||
@ -281,7 +355,10 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='fhrpgroupassignment',
|
||||
constraint=models.UniqueConstraint(fields=('interface_type', 'interface_id', 'group'), name='ipam_fhrpgroupassignment_unique_interface_group'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('interface_type', 'interface_id', 'group'),
|
||||
name='ipam_fhrpgroupassignment_unique_interface_group',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='vlan',
|
||||
@ -293,11 +370,15 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='vlangroup',
|
||||
constraint=models.UniqueConstraint(fields=('scope_type', 'scope_id', 'name'), name='ipam_vlangroup_unique_scope_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('scope_type', 'scope_id', 'name'), name='ipam_vlangroup_unique_scope_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='vlangroup',
|
||||
constraint=models.UniqueConstraint(fields=('scope_type', 'scope_id', 'slug'), name='ipam_vlangroup_unique_scope_slug'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('scope_type', 'scope_id', 'slug'), name='ipam_vlangroup_unique_scope_slug'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='aggregate',
|
||||
@ -365,15 +446,32 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('slug', models.SlugField(max_length=100, unique=True)),
|
||||
('start', ipam.fields.ASNField()),
|
||||
('end', ipam.fields.ASNField()),
|
||||
('rir', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='asn_ranges', to='ipam.rir')),
|
||||
(
|
||||
'rir',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='asn_ranges', to='ipam.rir'
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='asn_ranges', to='tenancy.tenant')),
|
||||
(
|
||||
'tenant',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='asn_ranges',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'ASN range',
|
||||
@ -388,6 +486,11 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='ipaddress',
|
||||
index=models.Index(django.db.models.functions.comparison.Cast(ipam.lookups.Host('address'), output_field=ipam.fields.IPAddressField()), name='ipam_ipaddress_host'),
|
||||
index=models.Index(
|
||||
django.db.models.functions.comparison.Cast(
|
||||
ipam.lookups.Host('address'), output_field=ipam.fields.IPAddressField()
|
||||
),
|
||||
name='ipam_ipaddress_host',
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -15,7 +15,6 @@ def update_content_types(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ipam', '0067_ipaddress_index_host'),
|
||||
]
|
||||
@ -57,8 +56,5 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
],
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=update_content_types,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=update_content_types, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ipam', '0068_move_l2vpn'),
|
||||
]
|
||||
@ -16,7 +15,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='ipaddress',
|
||||
index=models.Index(fields=['assigned_object_type', 'assigned_object_id'], name='ipam_ipaddr_assigne_890ab8_idx'),
|
||||
index=models.Index(
|
||||
fields=['assigned_object_type', 'assigned_object_id'], name='ipam_ipaddr_assigne_890ab8_idx'
|
||||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='vlangroup',
|
||||
|
@ -12,15 +12,12 @@ def set_vid_ranges(apps, schema_editor):
|
||||
"""
|
||||
VLANGroup = apps.get_model('ipam', 'VLANGroup')
|
||||
for group in VLANGroup.objects.all():
|
||||
group.vid_ranges = [
|
||||
NumericRange(group.min_vid, group.max_vid, bounds='[]')
|
||||
]
|
||||
group.vid_ranges = [NumericRange(group.min_vid, group.max_vid, bounds='[]')]
|
||||
group._total_vlan_ids = group.max_vid - group.min_vid + 1
|
||||
group.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ipam', '0069_gfk_indexes'),
|
||||
]
|
||||
@ -32,7 +29,7 @@ class Migration(migrations.Migration):
|
||||
field=django.contrib.postgres.fields.ArrayField(
|
||||
base_field=django.contrib.postgres.fields.ranges.IntegerRangeField(),
|
||||
default=ipam.models.vlans.default_vid_ranges,
|
||||
size=None
|
||||
size=None,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
@ -40,10 +37,7 @@ class Migration(migrations.Migration):
|
||||
name='_total_vlan_ids',
|
||||
field=models.PositiveBigIntegerField(default=4094),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=set_vid_ranges,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=set_vid_ranges, reverse_code=migrations.RunPython.noop),
|
||||
migrations.RemoveField(
|
||||
model_name='vlangroup',
|
||||
name='max_vid',
|
||||
|
@ -11,13 +11,11 @@ def copy_site_assignments(apps, schema_editor):
|
||||
Site = apps.get_model('dcim', 'Site')
|
||||
|
||||
Prefix.objects.filter(site__isnull=False).update(
|
||||
scope_type=ContentType.objects.get_for_model(Site),
|
||||
scope_id=models.F('site_id')
|
||||
scope_type=ContentType.objects.get_for_model(Site), scope_id=models.F('site_id')
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
('ipam', '0070_vlangroup_vlan_id_ranges'),
|
||||
@ -39,13 +37,9 @@ class Migration(migrations.Migration):
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='+',
|
||||
to='contenttypes.contenttype'
|
||||
to='contenttypes.contenttype',
|
||||
),
|
||||
),
|
||||
|
||||
# Copy over existing site assignments
|
||||
migrations.RunPython(
|
||||
code=copy_site_assignments,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=copy_site_assignments, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -19,7 +19,6 @@ def populate_denormalized_fields(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0193_poweroutlet_color'),
|
||||
('ipam', '0071_prefix_scope'),
|
||||
@ -29,12 +28,16 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='prefix',
|
||||
name='_location',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.location'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.location'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='prefix',
|
||||
name='_region',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.region'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.region'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='prefix',
|
||||
@ -44,15 +47,12 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='prefix',
|
||||
name='_site_group',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.sitegroup'),
|
||||
field=models.ForeignKey(
|
||||
blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dcim.sitegroup'
|
||||
),
|
||||
),
|
||||
|
||||
# Populate denormalized FK values
|
||||
migrations.RunPython(
|
||||
code=populate_denormalized_fields,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
|
||||
migrations.RunPython(code=populate_denormalized_fields, reverse_code=migrations.RunPython.noop),
|
||||
# Delete the site ForeignKey
|
||||
migrations.RemoveField(
|
||||
model_name='prefix',
|
||||
|
@ -13,7 +13,6 @@ def set_null_values(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ipam', '0072_prefix_cached_relations'),
|
||||
]
|
||||
@ -29,8 +28,5 @@ class Migration(migrations.Migration):
|
||||
name='role',
|
||||
field=models.CharField(blank=True, max_length=50, null=True),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=set_null_values,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=set_null_values, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -8,7 +8,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0121_customfield_related_object_filter'),
|
||||
('ipam', '0073_charfield_null_choices'),
|
||||
@ -21,7 +20,10 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('comments', models.TextField(blank=True)),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
@ -39,24 +41,57 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
('local_vid', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(4094)])),
|
||||
('remote_vid', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(4094)])),
|
||||
('policy', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rules', to='ipam.vlantranslationpolicy')),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
(
|
||||
'local_vid',
|
||||
models.PositiveSmallIntegerField(
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(4094),
|
||||
]
|
||||
),
|
||||
),
|
||||
(
|
||||
'remote_vid',
|
||||
models.PositiveSmallIntegerField(
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(4094),
|
||||
]
|
||||
),
|
||||
),
|
||||
(
|
||||
'policy',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='rules',
|
||||
to='ipam.vlantranslationpolicy',
|
||||
),
|
||||
),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'VLAN translation rule',
|
||||
'ordering': ('policy', 'local_vid',),
|
||||
'ordering': (
|
||||
'policy',
|
||||
'local_vid',
|
||||
),
|
||||
},
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='vlantranslationrule',
|
||||
constraint=models.UniqueConstraint(fields=('policy', 'local_vid'), name='ipam_vlantranslationrule_unique_policy_local_vid'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('policy', 'local_vid'), name='ipam_vlantranslationrule_unique_policy_local_vid'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='vlantranslationrule',
|
||||
constraint=models.UniqueConstraint(fields=('policy', 'remote_vid'), name='ipam_vlantranslationrule_unique_policy_remote_vid'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('policy', 'remote_vid'), name='ipam_vlantranslationrule_unique_policy_remote_vid'
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ipam', '0074_vlantranslationpolicy_vlantranslationrule'),
|
||||
]
|
||||
@ -17,7 +16,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='vlan',
|
||||
name='qinq_svlan',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='qinq_cvlans', to='ipam.vlan'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='qinq_cvlans',
|
||||
to='ipam.vlan',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='vlan',
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ipam', '0075_vlan_qinq'),
|
||||
('dcim', '0197_natural_sort_collation'),
|
||||
|
@ -6,7 +6,6 @@ import taggit.managers
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
@ -43,7 +42,16 @@ class Migration(migrations.Migration):
|
||||
('rght', models.PositiveIntegerField(editable=False)),
|
||||
('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
||||
('level', models.PositiveIntegerField(editable=False)),
|
||||
('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='tenancy.tenantgroup')),
|
||||
(
|
||||
'parent',
|
||||
mptt.fields.TreeForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='children',
|
||||
to='tenancy.tenantgroup',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
@ -60,7 +68,16 @@ class Migration(migrations.Migration):
|
||||
('slug', models.SlugField(max_length=100, unique=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('comments', models.TextField(blank=True)),
|
||||
('group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='tenants', to='tenancy.tenantgroup')),
|
||||
(
|
||||
'group',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='tenants',
|
||||
to='tenancy.tenantgroup',
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
options={
|
||||
|
@ -7,7 +7,6 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('tenancy', '0002_tenant_ordering'),
|
||||
('tenancy', '0003_contacts'),
|
||||
@ -18,7 +17,7 @@ class Migration(migrations.Migration):
|
||||
('tenancy', '0008_unique_constraints'),
|
||||
('tenancy', '0009_standardize_description_comments'),
|
||||
('tenancy', '0010_tenant_relax_uniqueness'),
|
||||
('tenancy', '0011_contactassignment_tags')
|
||||
('tenancy', '0011_contactassignment_tags'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -37,7 +36,10 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('slug', models.SlugField(max_length=100, unique=True)),
|
||||
@ -53,7 +55,10 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('slug', models.SlugField(max_length=100)),
|
||||
@ -62,7 +67,16 @@ class Migration(migrations.Migration):
|
||||
('rght', models.PositiveIntegerField(editable=False)),
|
||||
('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
||||
('level', models.PositiveIntegerField(editable=False)),
|
||||
('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='tenancy.contactgroup')),
|
||||
(
|
||||
'parent',
|
||||
mptt.fields.TreeForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='children',
|
||||
to='tenancy.contactgroup',
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
],
|
||||
options={
|
||||
@ -75,7 +89,10 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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)),
|
||||
(
|
||||
'custom_field_data',
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('title', models.CharField(blank=True, max_length=100)),
|
||||
@ -83,7 +100,16 @@ class Migration(migrations.Migration):
|
||||
('email', models.EmailField(blank=True, max_length=254)),
|
||||
('address', models.CharField(blank=True, max_length=200)),
|
||||
('comments', models.TextField(blank=True)),
|
||||
('group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='contacts', to='tenancy.contactgroup')),
|
||||
(
|
||||
'group',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='contacts',
|
||||
to='tenancy.contactgroup',
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('link', models.URLField(blank=True)),
|
||||
],
|
||||
@ -125,9 +151,24 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('object_id', models.PositiveBigIntegerField()),
|
||||
('priority', models.CharField(blank=True, max_length=50)),
|
||||
('contact', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='assignments', to='tenancy.contact')),
|
||||
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
|
||||
('role', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='assignments', to='tenancy.contactrole')),
|
||||
(
|
||||
'contact',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='assignments', to='tenancy.contact'
|
||||
),
|
||||
),
|
||||
(
|
||||
'content_type',
|
||||
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'),
|
||||
),
|
||||
(
|
||||
'role',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='assignments',
|
||||
to='tenancy.contactrole',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('priority', 'contact'),
|
||||
@ -140,11 +181,16 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='contactassignment',
|
||||
constraint=models.UniqueConstraint(fields=('content_type', 'object_id', 'contact', 'role'), name='tenancy_contactassignment_unique_object_contact_role'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('content_type', 'object_id', 'contact', 'role'),
|
||||
name='tenancy_contactassignment_unique_object_contact_role',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='contactgroup',
|
||||
constraint=models.UniqueConstraint(fields=('parent', 'name'), name='tenancy_contactgroup_unique_parent_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('parent', 'name'), name='tenancy_contactgroup_unique_parent_name'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='contact',
|
||||
@ -163,19 +209,31 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='tenant',
|
||||
constraint=models.UniqueConstraint(fields=('group', 'name'), name='tenancy_tenant_unique_group_name', violation_error_message='Tenant name must be unique per group.'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('group', 'name'),
|
||||
name='tenancy_tenant_unique_group_name',
|
||||
violation_error_message='Tenant name must be unique per group.',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='tenant',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('group__isnull', True)), fields=('name',), name='tenancy_tenant_unique_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('group__isnull', True)), fields=('name',), name='tenancy_tenant_unique_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='tenant',
|
||||
constraint=models.UniqueConstraint(fields=('group', 'slug'), name='tenancy_tenant_unique_group_slug', violation_error_message='Tenant slug must be unique per group.'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('group', 'slug'),
|
||||
name='tenancy_tenant_unique_group_slug',
|
||||
violation_error_message='Tenant slug must be unique per group.',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='tenant',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('group__isnull', True)), fields=('slug',), name='tenancy_tenant_unique_slug'),
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(('group__isnull', True)), fields=('slug',), name='tenancy_tenant_unique_slug'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='contactassignment',
|
||||
|
@ -5,7 +5,6 @@ import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('tenancy', '0011_contactassignment_tags'),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('tenancy', '0012_contactassignment_custom_fields'),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('tenancy', '0013_gfk_indexes'),
|
||||
]
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
('extras', '0111_rename_content_types'),
|
||||
@ -25,16 +24,13 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='contactassignment',
|
||||
index=models.Index(
|
||||
fields=['object_type', 'object_id'],
|
||||
name='tenancy_con_object__6f20f7_idx'
|
||||
),
|
||||
index=models.Index(fields=['object_type', 'object_id'], name='tenancy_con_object__6f20f7_idx'),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='contactassignment',
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('object_type', 'object_id', 'contact', 'role'),
|
||||
name='tenancy_contactassignment_unique_object_contact_role'
|
||||
name='tenancy_contactassignment_unique_object_contact_role',
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -11,7 +11,6 @@ def set_null_values(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('tenancy', '0015_contactassignment_rename_content_type'),
|
||||
]
|
||||
@ -22,8 +21,5 @@ class Migration(migrations.Migration):
|
||||
name='priority',
|
||||
field=models.CharField(blank=True, max_length=50, null=True),
|
||||
),
|
||||
migrations.RunPython(
|
||||
code=set_null_values,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=set_null_values, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('tenancy', '0016_charfield_null_choices'),
|
||||
('dcim', '0197_natural_sort_collation'),
|
||||
|
@ -8,7 +8,6 @@ import users.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
@ -39,15 +38,33 @@ class Migration(migrations.Migration):
|
||||
('password', models.CharField(max_length=128)),
|
||||
('last_login', models.DateTimeField(blank=True, null=True)),
|
||||
('is_superuser', models.BooleanField(default=False)),
|
||||
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()])),
|
||||
(
|
||||
'username',
|
||||
models.CharField(
|
||||
error_messages={'unique': 'A user with that username already exists.'},
|
||||
max_length=150,
|
||||
unique=True,
|
||||
validators=[django.contrib.auth.validators.UnicodeUsernameValidator()],
|
||||
),
|
||||
),
|
||||
('first_name', models.CharField(blank=True, max_length=150)),
|
||||
('last_name', models.CharField(blank=True, max_length=150)),
|
||||
('email', models.EmailField(blank=True, max_length=254)),
|
||||
('is_staff', models.BooleanField(default=False)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('date_joined', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('groups', models.ManyToManyField(blank=True, related_name='user_set', related_query_name='user', to='auth.group')),
|
||||
('user_permissions', models.ManyToManyField(blank=True, related_name='user_set', related_query_name='user', to='auth.permission')),
|
||||
(
|
||||
'groups',
|
||||
models.ManyToManyField(
|
||||
blank=True, related_name='user_set', related_query_name='user', to='auth.group'
|
||||
),
|
||||
),
|
||||
(
|
||||
'user_permissions',
|
||||
models.ManyToManyField(
|
||||
blank=True, related_name='user_set', related_query_name='user', to='auth.permission'
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'user',
|
||||
@ -64,7 +81,12 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('data', models.JSONField(default=dict)),
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='config', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'user',
|
||||
models.OneToOneField(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='config', to=settings.AUTH_USER_MODEL
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'User Preferences',
|
||||
@ -78,10 +100,20 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('expires', models.DateTimeField(blank=True, null=True)),
|
||||
('key', models.CharField(max_length=40, unique=True, validators=[django.core.validators.MinLengthValidator(40)])),
|
||||
(
|
||||
'key',
|
||||
models.CharField(
|
||||
max_length=40, unique=True, validators=[django.core.validators.MinLengthValidator(40)]
|
||||
),
|
||||
),
|
||||
('write_enabled', models.BooleanField(default=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tokens', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'user',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name='tokens', to=settings.AUTH_USER_MODEL
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@ -91,11 +123,37 @@ class Migration(migrations.Migration):
|
||||
('name', models.CharField(max_length=100)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('enabled', models.BooleanField(default=True)),
|
||||
('actions', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=30), size=None)),
|
||||
(
|
||||
'actions',
|
||||
django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=30), size=None),
|
||||
),
|
||||
('constraints', models.JSONField(blank=True, null=True)),
|
||||
('groups', models.ManyToManyField(blank=True, related_name='object_permissions', to='auth.Group')),
|
||||
('object_types', models.ManyToManyField(limit_choices_to=models.Q(models.Q(models.Q(('app_label__in', ['account', 'admin', 'auth', 'contenttypes', 'sessions', 'taggit', 'users']), _negated=True), models.Q(('app_label', 'auth'), ('model__in', ['group', 'user'])), models.Q(('app_label', 'users'), ('model__in', ['objectpermission', 'token'])), _connector='OR')), related_name='object_permissions', to='contenttypes.ContentType')),
|
||||
('users', models.ManyToManyField(blank=True, related_name='object_permissions', to=settings.AUTH_USER_MODEL)),
|
||||
(
|
||||
'object_types',
|
||||
models.ManyToManyField(
|
||||
limit_choices_to=models.Q(
|
||||
models.Q(
|
||||
models.Q(
|
||||
(
|
||||
'app_label__in',
|
||||
['account', 'admin', 'auth', 'contenttypes', 'sessions', 'taggit', 'users'],
|
||||
),
|
||||
_negated=True,
|
||||
),
|
||||
models.Q(('app_label', 'auth'), ('model__in', ['group', 'user'])),
|
||||
models.Q(('app_label', 'users'), ('model__in', ['objectpermission', 'token'])),
|
||||
_connector='OR',
|
||||
)
|
||||
),
|
||||
related_name='object_permissions',
|
||||
to='contenttypes.ContentType',
|
||||
),
|
||||
),
|
||||
(
|
||||
'users',
|
||||
models.ManyToManyField(blank=True, related_name='object_permissions', to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'permission',
|
||||
|
@ -5,11 +5,10 @@ import ipam.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('users', '0002_standardize_id_fields'),
|
||||
('users', '0003_token_allowed_ips_last_used'),
|
||||
('users', '0004_netboxgroup_netboxuser')
|
||||
('users', '0004_netboxgroup_netboxuser'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -36,7 +35,9 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='token',
|
||||
name='allowed_ips',
|
||||
field=django.contrib.postgres.fields.ArrayField(base_field=ipam.fields.IPNetworkField(), blank=True, null=True, size=None),
|
||||
field=django.contrib.postgres.fields.ArrayField(
|
||||
base_field=ipam.fields.IPNetworkField(), blank=True, null=True, size=None
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='token',
|
||||
@ -45,8 +46,7 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='NetBoxGroup',
|
||||
fields=[
|
||||
],
|
||||
fields=[],
|
||||
options={
|
||||
'verbose_name': 'Group',
|
||||
'proxy': True,
|
||||
|
@ -19,7 +19,6 @@ def update_content_types(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0002_squashed_0004'),
|
||||
('extras', '0113_customfield_rename_object_type'),
|
||||
@ -33,24 +32,17 @@ class Migration(migrations.Migration):
|
||||
name='user',
|
||||
table=None,
|
||||
),
|
||||
|
||||
# Convert the `id` column to a 64-bit integer (BigAutoField is implied by DEFAULT_AUTO_FIELD)
|
||||
migrations.RunSQL("ALTER TABLE users_user ALTER COLUMN id TYPE bigint"),
|
||||
|
||||
migrations.RunSQL('ALTER TABLE users_user ALTER COLUMN id TYPE bigint'),
|
||||
# Rename auth_user_* sequences
|
||||
migrations.RunSQL("ALTER TABLE auth_user_groups_id_seq RENAME TO users_user_groups_id_seq"),
|
||||
migrations.RunSQL("ALTER TABLE auth_user_id_seq RENAME TO users_user_id_seq"),
|
||||
migrations.RunSQL("ALTER TABLE auth_user_user_permissions_id_seq RENAME TO users_user_user_permissions_id_seq"),
|
||||
|
||||
migrations.RunSQL('ALTER TABLE auth_user_groups_id_seq RENAME TO users_user_groups_id_seq'),
|
||||
migrations.RunSQL('ALTER TABLE auth_user_id_seq RENAME TO users_user_id_seq'),
|
||||
migrations.RunSQL('ALTER TABLE auth_user_user_permissions_id_seq RENAME TO users_user_user_permissions_id_seq'),
|
||||
# Rename auth_user_* indexes
|
||||
migrations.RunSQL("ALTER INDEX auth_user_pkey RENAME TO users_user_pkey"),
|
||||
migrations.RunSQL('ALTER INDEX auth_user_pkey RENAME TO users_user_pkey'),
|
||||
# Hash is deterministic; generated via schema_editor._create_index_name()
|
||||
migrations.RunSQL("ALTER INDEX auth_user_username_6821ab7c_like RENAME TO users_user_username_06e46fe6_like"),
|
||||
migrations.RunSQL("ALTER INDEX auth_user_username_key RENAME TO users_user_username_key"),
|
||||
|
||||
migrations.RunSQL('ALTER INDEX auth_user_username_6821ab7c_like RENAME TO users_user_username_06e46fe6_like'),
|
||||
migrations.RunSQL('ALTER INDEX auth_user_username_key RENAME TO users_user_username_key'),
|
||||
# Update ContentTypes
|
||||
migrations.RunPython(
|
||||
code=update_content_types,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=update_content_types, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
|
@ -16,7 +16,6 @@ def update_custom_fields(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0005_alter_user_table'),
|
||||
]
|
||||
@ -29,7 +28,12 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=150, unique=True)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('permissions', models.ManyToManyField(blank=True, related_name='groups', related_query_name='group', to='auth.permission')),
|
||||
(
|
||||
'permissions',
|
||||
models.ManyToManyField(
|
||||
blank=True, related_name='groups', related_query_name='group', to='auth.permission'
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('name',),
|
||||
@ -40,17 +44,10 @@ class Migration(migrations.Migration):
|
||||
('objects', users.models.GroupManager()),
|
||||
],
|
||||
),
|
||||
|
||||
# Copy existing groups from the old table into the new one
|
||||
migrations.RunSQL(
|
||||
"INSERT INTO users_group (SELECT id, name, '' AS description FROM auth_group)"
|
||||
),
|
||||
|
||||
migrations.RunSQL("INSERT INTO users_group (SELECT id, name, '' AS description FROM auth_group)"),
|
||||
# Update the sequence for group ID values
|
||||
migrations.RunSQL(
|
||||
"SELECT setval('users_group_id_seq', (SELECT MAX(id) FROM users_group))"
|
||||
),
|
||||
|
||||
migrations.RunSQL("SELECT setval('users_group_id_seq', (SELECT MAX(id) FROM users_group))"),
|
||||
# Update the "groups" M2M fields on User & ObjectPermission
|
||||
migrations.AlterField(
|
||||
model_name='user',
|
||||
@ -62,23 +59,12 @@ class Migration(migrations.Migration):
|
||||
name='groups',
|
||||
field=models.ManyToManyField(blank=True, related_name='object_permissions', to='users.group'),
|
||||
),
|
||||
|
||||
# Delete any lingering group assignments for legacy permissions (from before NetBox v2.9)
|
||||
migrations.RunSQL(
|
||||
"DELETE from auth_group_permissions"
|
||||
),
|
||||
|
||||
migrations.RunSQL('DELETE from auth_group_permissions'),
|
||||
# Delete groups from the old table
|
||||
migrations.RunSQL(
|
||||
"DELETE from auth_group"
|
||||
),
|
||||
|
||||
migrations.RunSQL('DELETE from auth_group'),
|
||||
# Update custom fields
|
||||
migrations.RunPython(
|
||||
code=update_custom_fields,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
|
||||
migrations.RunPython(code=update_custom_fields, reverse_code=migrations.RunPython.noop),
|
||||
# Delete the proxy model
|
||||
migrations.DeleteModel(
|
||||
name='NetBoxGroup',
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0010_gfk_indexes'),
|
||||
('users', '0006_custom_group_model'),
|
||||
@ -14,6 +13,23 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='objectpermission',
|
||||
name='object_types',
|
||||
field=models.ManyToManyField(limit_choices_to=models.Q(models.Q(models.Q(('app_label__in', ['account', 'admin', 'auth', 'contenttypes', 'sessions', 'taggit', 'users']), _negated=True), models.Q(('app_label', 'auth'), ('model__in', ['group', 'user'])), models.Q(('app_label', 'users'), ('model__in', ['objectpermission', 'token'])), _connector='OR')), related_name='object_permissions', to='core.objecttype'),
|
||||
field=models.ManyToManyField(
|
||||
limit_choices_to=models.Q(
|
||||
models.Q(
|
||||
models.Q(
|
||||
(
|
||||
'app_label__in',
|
||||
['account', 'admin', 'auth', 'contenttypes', 'sessions', 'taggit', 'users'],
|
||||
),
|
||||
_negated=True,
|
||||
),
|
||||
models.Q(('app_label', 'auth'), ('model__in', ['group', 'user'])),
|
||||
models.Q(('app_label', 'users'), ('model__in', ['objectpermission', 'token'])),
|
||||
_connector='OR',
|
||||
)
|
||||
),
|
||||
related_name='object_permissions',
|
||||
to='core.objecttype',
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0007_objectpermission_update_object_types'),
|
||||
]
|
||||
@ -24,52 +23,47 @@ class Migration(migrations.Migration):
|
||||
database_operations=[
|
||||
# Rename table
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE users_objectpermission_groups"
|
||||
" RENAME TO users_group_object_permissions"
|
||||
'ALTER TABLE users_objectpermission_groups' ' RENAME TO users_group_object_permissions'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE users_objectpermission_groups_id_seq"
|
||||
" RENAME TO users_group_object_permissions_id_seq"
|
||||
'ALTER TABLE users_objectpermission_groups_id_seq'
|
||||
' RENAME TO users_group_object_permissions_id_seq'
|
||||
),
|
||||
|
||||
# Rename constraints
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE users_group_object_permissions RENAME CONSTRAINT "
|
||||
"users_objectpermissi_group_id_fb7ba6e0_fk_users_gro TO "
|
||||
"users_group_object_p_group_id_90dd183a_fk_users_gro"
|
||||
'ALTER TABLE users_group_object_permissions RENAME CONSTRAINT '
|
||||
'users_objectpermissi_group_id_fb7ba6e0_fk_users_gro TO '
|
||||
'users_group_object_p_group_id_90dd183a_fk_users_gro'
|
||||
),
|
||||
# Fix for #15698: Drop & recreate constraint which may not exist
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE users_group_object_permissions DROP CONSTRAINT IF EXISTS "
|
||||
"users_objectpermissi_objectpermission_id_2f7cc117_fk_users_obj"
|
||||
'ALTER TABLE users_group_object_permissions DROP CONSTRAINT IF EXISTS '
|
||||
'users_objectpermissi_objectpermission_id_2f7cc117_fk_users_obj'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE users_group_object_permissions ADD CONSTRAINT "
|
||||
"users_group_object_p_objectpermission_id_dd489dc4_fk_users_obj "
|
||||
"FOREIGN KEY (objectpermission_id) REFERENCES users_objectpermission(id) "
|
||||
"DEFERRABLE INITIALLY DEFERRED"
|
||||
'ALTER TABLE users_group_object_permissions ADD CONSTRAINT '
|
||||
'users_group_object_p_objectpermission_id_dd489dc4_fk_users_obj '
|
||||
'FOREIGN KEY (objectpermission_id) REFERENCES users_objectpermission(id) '
|
||||
'DEFERRABLE INITIALLY DEFERRED'
|
||||
),
|
||||
|
||||
# Rename indexes
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX users_objectpermission_groups_pkey "
|
||||
" RENAME TO users_group_object_permissions_pkey"
|
||||
'ALTER INDEX users_objectpermission_groups_pkey ' ' RENAME TO users_group_object_permissions_pkey'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX users_objectpermission_g_objectpermission_id_grou_3b62a39c_uniq "
|
||||
" RENAME TO users_group_object_permi_group_id_objectpermissio_db1f8cbe_uniq"
|
||||
'ALTER INDEX users_objectpermission_g_objectpermission_id_grou_3b62a39c_uniq '
|
||||
' RENAME TO users_group_object_permi_group_id_objectpermissio_db1f8cbe_uniq'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX users_objectpermission_groups_group_id_fb7ba6e0"
|
||||
" RENAME TO users_group_object_permissions_group_id_90dd183a"
|
||||
'ALTER INDEX users_objectpermission_groups_group_id_fb7ba6e0'
|
||||
' RENAME TO users_group_object_permissions_group_id_90dd183a'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX users_objectpermission_groups_objectpermission_id_2f7cc117"
|
||||
" RENAME TO users_group_object_permissions_objectpermission_id_dd489dc4"
|
||||
'ALTER INDEX users_objectpermission_groups_objectpermission_id_2f7cc117'
|
||||
' RENAME TO users_group_object_permissions_objectpermission_id_dd489dc4'
|
||||
),
|
||||
]
|
||||
],
|
||||
),
|
||||
|
||||
# Flip M2M assignments for ObjectPermission to Users
|
||||
migrations.SeparateDatabaseAndState(
|
||||
state_operations=[
|
||||
@ -86,49 +80,44 @@ class Migration(migrations.Migration):
|
||||
database_operations=[
|
||||
# Rename table
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE users_objectpermission_users"
|
||||
" RENAME TO users_user_object_permissions"
|
||||
'ALTER TABLE users_objectpermission_users' ' RENAME TO users_user_object_permissions'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE users_objectpermission_users_id_seq"
|
||||
" RENAME TO users_user_object_permissions_id_seq"
|
||||
'ALTER TABLE users_objectpermission_users_id_seq' ' RENAME TO users_user_object_permissions_id_seq'
|
||||
),
|
||||
|
||||
# Rename constraints
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE users_user_object_permissions RENAME CONSTRAINT "
|
||||
"users_objectpermission_users_user_id_16c0905d_fk_auth_user_id TO "
|
||||
"users_user_object_permissions_user_id_9d647aac_fk_users_user_id"
|
||||
'ALTER TABLE users_user_object_permissions RENAME CONSTRAINT '
|
||||
'users_objectpermission_users_user_id_16c0905d_fk_auth_user_id TO '
|
||||
'users_user_object_permissions_user_id_9d647aac_fk_users_user_id'
|
||||
),
|
||||
# Fix for #15698: Drop & recreate constraint which may not exist
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE users_user_object_permissions DROP CONSTRAINT IF EXISTS "
|
||||
"users_objectpermissi_objectpermission_id_78a9c2e6_fk_users_obj"
|
||||
'ALTER TABLE users_user_object_permissions DROP CONSTRAINT IF EXISTS '
|
||||
'users_objectpermissi_objectpermission_id_78a9c2e6_fk_users_obj'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER TABLE users_user_object_permissions ADD CONSTRAINT "
|
||||
"users_user_object_pe_objectpermission_id_29b431b4_fk_users_obj "
|
||||
"FOREIGN KEY (objectpermission_id) REFERENCES users_objectpermission(id) "
|
||||
"DEFERRABLE INITIALLY DEFERRED"
|
||||
'ALTER TABLE users_user_object_permissions ADD CONSTRAINT '
|
||||
'users_user_object_pe_objectpermission_id_29b431b4_fk_users_obj '
|
||||
'FOREIGN KEY (objectpermission_id) REFERENCES users_objectpermission(id) '
|
||||
'DEFERRABLE INITIALLY DEFERRED'
|
||||
),
|
||||
|
||||
# Rename indexes
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX users_objectpermission_users_pkey "
|
||||
" RENAME TO users_user_object_permissions_pkey"
|
||||
'ALTER INDEX users_objectpermission_users_pkey ' ' RENAME TO users_user_object_permissions_pkey'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX users_objectpermission_u_objectpermission_id_user_3a7db108_uniq "
|
||||
" RENAME TO users_user_object_permis_user_id_objectpermission_0a98550e_uniq"
|
||||
'ALTER INDEX users_objectpermission_u_objectpermission_id_user_3a7db108_uniq '
|
||||
' RENAME TO users_user_object_permis_user_id_objectpermission_0a98550e_uniq'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX users_objectpermission_users_user_id_16c0905d"
|
||||
" RENAME TO users_user_object_permissions_user_id_9d647aac"
|
||||
'ALTER INDEX users_objectpermission_users_user_id_16c0905d'
|
||||
' RENAME TO users_user_object_permissions_user_id_9d647aac'
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"ALTER INDEX users_objectpermission_users_objectpermission_id_78a9c2e6"
|
||||
" RENAME TO users_user_object_permissions_objectpermission_id_29b431b4"
|
||||
'ALTER INDEX users_objectpermission_users_objectpermission_id_78a9c2e6'
|
||||
' RENAME TO users_user_object_permissions_objectpermission_id_29b431b4'
|
||||
),
|
||||
]
|
||||
],
|
||||
),
|
||||
]
|
||||
|
@ -18,17 +18,13 @@ def update_content_types(apps, schema_editor):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0008_flip_objectpermission_assignments'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
# Update ContentTypes
|
||||
migrations.RunPython(
|
||||
code=update_content_types,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
migrations.RunPython(code=update_content_types, reverse_code=migrations.RunPython.noop),
|
||||
migrations.AlterField(
|
||||
model_name='objectpermission',
|
||||
name='object_types',
|
||||
|
@ -10,7 +10,6 @@ import utilities.query_functions
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
@ -100,17 +99,79 @@ class Migration(migrations.Migration):
|
||||
('local_context_data', models.JSONField(blank=True, null=True)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('status', models.CharField(default='active', max_length=50)),
|
||||
('vcpus', models.DecimalField(blank=True, decimal_places=2, max_digits=6, null=True, validators=[django.core.validators.MinValueValidator(0.01)])),
|
||||
(
|
||||
'vcpus',
|
||||
models.DecimalField(
|
||||
blank=True,
|
||||
decimal_places=2,
|
||||
max_digits=6,
|
||||
null=True,
|
||||
validators=[django.core.validators.MinValueValidator(0.01)],
|
||||
),
|
||||
),
|
||||
('memory', models.PositiveIntegerField(blank=True, null=True)),
|
||||
('disk', models.PositiveIntegerField(blank=True, null=True)),
|
||||
('comments', models.TextField(blank=True)),
|
||||
('cluster', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='virtual_machines', to='virtualization.cluster')),
|
||||
('platform', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='virtual_machines', to='dcim.platform')),
|
||||
('primary_ip4', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='ipam.ipaddress')),
|
||||
('primary_ip6', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='ipam.ipaddress')),
|
||||
('role', models.ForeignKey(blank=True, limit_choices_to={'vm_role': True}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='virtual_machines', to='dcim.devicerole')),
|
||||
(
|
||||
'cluster',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='virtual_machines',
|
||||
to='virtualization.cluster',
|
||||
),
|
||||
),
|
||||
(
|
||||
'platform',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='virtual_machines',
|
||||
to='dcim.platform',
|
||||
),
|
||||
),
|
||||
(
|
||||
'primary_ip4',
|
||||
models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
(
|
||||
'primary_ip6',
|
||||
models.OneToOneField(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='+',
|
||||
to='ipam.ipaddress',
|
||||
),
|
||||
),
|
||||
(
|
||||
'role',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
limit_choices_to={'vm_role': True},
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='virtual_machines',
|
||||
to='dcim.devicerole',
|
||||
),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='virtual_machines', to='tenancy.tenant')),
|
||||
(
|
||||
'tenant',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='virtual_machines',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('name', 'pk'),
|
||||
@ -120,12 +181,24 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='cluster',
|
||||
name='group',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='clusters', to='virtualization.clustergroup'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='clusters',
|
||||
to='virtualization.clustergroup',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cluster',
|
||||
name='site',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='clusters', to='dcim.site'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='clusters',
|
||||
to='dcim.site',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cluster',
|
||||
@ -135,12 +208,20 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='cluster',
|
||||
name='tenant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='clusters', to='tenancy.tenant'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='clusters',
|
||||
to='tenancy.tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cluster',
|
||||
name='type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='clusters', to='virtualization.clustertype'),
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, related_name='clusters', to='virtualization.clustertype'
|
||||
),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='VMInterface',
|
||||
@ -151,16 +232,59 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('enabled', models.BooleanField(default=True)),
|
||||
('mac_address', dcim.fields.MACAddressField(blank=True, null=True)),
|
||||
('mtu', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65536)])),
|
||||
(
|
||||
'mtu',
|
||||
models.PositiveIntegerField(
|
||||
blank=True,
|
||||
null=True,
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(65536),
|
||||
],
|
||||
),
|
||||
),
|
||||
('mode', models.CharField(blank=True, max_length=50)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize_interface)),
|
||||
(
|
||||
'_name',
|
||||
utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize_interface
|
||||
),
|
||||
),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='child_interfaces', to='virtualization.vminterface')),
|
||||
('tagged_vlans', models.ManyToManyField(blank=True, related_name='vminterfaces_as_tagged', to='ipam.VLAN')),
|
||||
(
|
||||
'parent',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='child_interfaces',
|
||||
to='virtualization.vminterface',
|
||||
),
|
||||
),
|
||||
(
|
||||
'tagged_vlans',
|
||||
models.ManyToManyField(blank=True, related_name='vminterfaces_as_tagged', to='ipam.VLAN'),
|
||||
),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('untagged_vlan', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vminterfaces_as_untagged', to='ipam.vlan')),
|
||||
('virtual_machine', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='interfaces', to='virtualization.virtualmachine')),
|
||||
(
|
||||
'untagged_vlan',
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='vminterfaces_as_untagged',
|
||||
to='ipam.vlan',
|
||||
),
|
||||
),
|
||||
(
|
||||
'virtual_machine',
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='interfaces',
|
||||
to='virtualization.virtualmachine',
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'interface',
|
||||
|
@ -7,7 +7,6 @@ import utilities.ordering
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('virtualization', '0023_virtualmachine_natural_ordering'),
|
||||
('virtualization', '0024_cluster_relax_uniqueness'),
|
||||
@ -22,7 +21,7 @@ class Migration(migrations.Migration):
|
||||
('virtualization', '0033_unique_constraints'),
|
||||
('virtualization', '0034_standardize_description_comments'),
|
||||
('virtualization', '0035_virtualmachine_interface_count'),
|
||||
('virtualization', '0036_virtualmachine_config_template')
|
||||
('virtualization', '0036_virtualmachine_config_template'),
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@ -40,7 +39,9 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='virtualmachine',
|
||||
name='_name',
|
||||
field=utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize),
|
||||
field=utilities.fields.NaturalOrderingField(
|
||||
'name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='cluster',
|
||||
@ -64,7 +65,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='vminterface',
|
||||
name='bridge',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='bridge_interfaces', to='virtualization.vminterface'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='bridge_interfaces',
|
||||
to='virtualization.vminterface',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='cluster',
|
||||
@ -94,7 +101,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='vminterface',
|
||||
name='vrf',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vminterfaces', to='ipam.vrf'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='vminterfaces',
|
||||
to='ipam.vrf',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='cluster',
|
||||
@ -129,17 +142,35 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='virtualmachine',
|
||||
name='site',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='virtual_machines', to='dcim.site'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='virtual_machines',
|
||||
to='dcim.site',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='virtualmachine',
|
||||
name='device',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='virtual_machines', to='dcim.device'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='virtual_machines',
|
||||
to='dcim.device',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='virtualmachine',
|
||||
name='cluster',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='virtual_machines', to='virtualization.cluster'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='virtual_machines',
|
||||
to='virtualization.cluster',
|
||||
),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='cluster',
|
||||
@ -155,7 +186,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='cluster',
|
||||
constraint=models.UniqueConstraint(fields=('group', 'name'), name='virtualization_cluster_unique_group_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('group', 'name'), name='virtualization_cluster_unique_group_name'
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='cluster',
|
||||
@ -163,15 +196,28 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='virtualmachine',
|
||||
constraint=models.UniqueConstraint(django.db.models.functions.text.Lower('name'), models.F('cluster'), models.F('tenant'), name='virtualization_virtualmachine_unique_name_cluster_tenant'),
|
||||
constraint=models.UniqueConstraint(
|
||||
django.db.models.functions.text.Lower('name'),
|
||||
models.F('cluster'),
|
||||
models.F('tenant'),
|
||||
name='virtualization_virtualmachine_unique_name_cluster_tenant',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='virtualmachine',
|
||||
constraint=models.UniqueConstraint(django.db.models.functions.text.Lower('name'), models.F('cluster'), condition=models.Q(('tenant__isnull', True)), name='virtualization_virtualmachine_unique_name_cluster', violation_error_message='Virtual machine name must be unique per cluster.'),
|
||||
constraint=models.UniqueConstraint(
|
||||
django.db.models.functions.text.Lower('name'),
|
||||
models.F('cluster'),
|
||||
condition=models.Q(('tenant__isnull', True)),
|
||||
name='virtualization_virtualmachine_unique_name_cluster',
|
||||
violation_error_message='Virtual machine name must be unique per cluster.',
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='vminterface',
|
||||
constraint=models.UniqueConstraint(fields=('virtual_machine', 'name'), name='virtualization_vminterface_unique_virtual_machine_name'),
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=('virtual_machine', 'name'), name='virtualization_vminterface_unique_virtual_machine_name'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cluster',
|
||||
@ -186,11 +232,19 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='virtualmachine',
|
||||
name='interface_count',
|
||||
field=utilities.fields.CounterCacheField(default=0, editable=False, to_field='virtual_machine', to_model='virtualization.VMInterface'),
|
||||
field=utilities.fields.CounterCacheField(
|
||||
default=0, editable=False, to_field='virtual_machine', to_model='virtualization.VMInterface'
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='virtualmachine',
|
||||
name='config_template',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='%(class)ss', to='extras.configtemplate'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name='%(class)ss',
|
||||
to='extras.configtemplate',
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -5,7 +5,6 @@ import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('virtualization', '0036_virtualmachine_config_template'),
|
||||
]
|
||||
@ -14,6 +13,12 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='vminterface',
|
||||
name='parent',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.RESTRICT, related_name='child_interfaces', to='virtualization.vminterface'),
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.RESTRICT,
|
||||
related_name='child_interfaces',
|
||||
to='virtualization.vminterface',
|
||||
),
|
||||
),
|
||||
]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user