mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Add model
This commit is contained in:
41
netbox/ipam/migrations/0069_vlandevicemappings.py
Normal file
41
netbox/ipam/migrations/0069_vlandevicemappings.py
Normal file
@ -0,0 +1,41 @@
|
||||
# Generated by Django 4.2.4 on 2023-11-30 15:25
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import taggit.managers
|
||||
import utilities.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0101_move_configrevision'),
|
||||
('dcim', '0183_protect_child_interfaces'),
|
||||
('ipam', '0068_move_l2vpn'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='VLANDeviceMapping',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
('created', models.DateTimeField(auto_now_add=True, null=True)),
|
||||
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('comments', models.TextField(blank=True)),
|
||||
('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='devices', to='dcim.device')),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
('vlan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vlans', to='ipam.vlan')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'VLAN to Device Termination',
|
||||
'verbose_name_plural': 'VLAN to Device Terminations',
|
||||
'ordering': ('device', 'vlan', 'pk'),
|
||||
},
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='vlandevicemapping',
|
||||
constraint=models.UniqueConstraint(fields=('device', 'vlan'), name='ipam_vlandevicemapping_unique_device_vlan'),
|
||||
),
|
||||
]
|
20
netbox/vpn/migrations/0003_vlandevicemappings.py
Normal file
20
netbox/vpn/migrations/0003_vlandevicemappings.py
Normal file
@ -0,0 +1,20 @@
|
||||
# Generated by Django 4.2.4 on 2023-11-30 15:25
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
('vpn', '0002_move_l2vpn'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='l2vpntermination',
|
||||
name='assigned_object_type',
|
||||
field=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')), models.Q(('app_label', 'ipam'), ('model', 'vlandevicemapping')), _connector='OR')), on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype'),
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user