|
| 1 | +# Generated by Django 4.1.2 on 2022-11-01 19:38 |
| 2 | + |
| 3 | +from django.db import migrations, models |
| 4 | +import django.db.models.deletion |
| 5 | +import taggit.managers |
| 6 | +import utilities.json |
| 7 | + |
| 8 | + |
| 9 | +class Migration(migrations.Migration): |
| 10 | + |
| 11 | + dependencies = [ |
| 12 | + ('ipam', '0062_unique_constraints'), |
| 13 | + ('extras', '0082_exporttemplate_content_types'), |
| 14 | + ('tenancy', '0008_unique_constraints'), |
| 15 | + ('dcim', '0164_rack_mounting_depth'), |
| 16 | + ] |
| 17 | + |
| 18 | + operations = [ |
| 19 | + migrations.AddField( |
| 20 | + model_name='devicetype', |
| 21 | + name='vdc_type', |
| 22 | + field=models.CharField(blank=True, max_length=50), |
| 23 | + ), |
| 24 | + migrations.CreateModel( |
| 25 | + name='VirtualDeviceContext', |
| 26 | + fields=[ |
| 27 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)), |
| 28 | + ('created', models.DateTimeField(auto_now_add=True, null=True)), |
| 29 | + ('last_updated', models.DateTimeField(auto_now=True, null=True)), |
| 30 | + ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)), |
| 31 | + ('name', models.CharField(max_length=64)), |
| 32 | + ('status', models.CharField(blank=True, max_length=50)), |
| 33 | + ('identifier', models.PositiveSmallIntegerField(blank=True, null=True)), |
| 34 | + ('comments', models.TextField(blank=True)), |
| 35 | + ('device', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vdcs', to='dcim.device')), |
| 36 | + ('primary_ip4', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='ipam.ipaddress')), |
| 37 | + ('primary_ip6', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='ipam.ipaddress')), |
| 38 | + ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')), |
| 39 | + ('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vdcs', to='tenancy.tenant')), |
| 40 | + ], |
| 41 | + options={ |
| 42 | + 'ordering': ['name'], |
| 43 | + }, |
| 44 | + ), |
| 45 | + migrations.AddField( |
| 46 | + model_name='interface', |
| 47 | + name='vdcs', |
| 48 | + field=models.ManyToManyField(related_name='interfaces', to='dcim.virtualdevicecontext'), |
| 49 | + ), |
| 50 | + migrations.AddConstraint( |
| 51 | + model_name='virtualdevicecontext', |
| 52 | + constraint=models.UniqueConstraint(fields=('device', 'identifier'), name='dcim_virtualdevicecontext_device_identifiers', violation_error_message='A VDC with this identifier already exists on this device.'), |
| 53 | + ), |
| 54 | + migrations.AddConstraint( |
| 55 | + model_name='virtualdevicecontext', |
| 56 | + constraint=models.UniqueConstraint(fields=('device', 'name'), name='dcim_virtualdevicecontext_name', violation_error_message='A VDC with this name already exists on this device.'), |
| 57 | + ), |
| 58 | + ] |
0 commit comments