diff --git a/netbox/vpn/migrations/0003_ipaddress_multiple_tunnel_terminations.py b/netbox/vpn/migrations/0003_ipaddress_multiple_tunnel_terminations.py new file mode 100644 index 00000000000..2747669ae31 --- /dev/null +++ b/netbox/vpn/migrations/0003_ipaddress_multiple_tunnel_terminations.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.8 on 2024-01-05 19:31 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('ipam', '0069_gfk_indexes'), + ('vpn', '0002_move_l2vpn'), + ] + + operations = [ + migrations.AlterField( + model_name='tunneltermination', + name='outside_ip', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tunnel_terminations', to='ipam.ipaddress'), + ), + ] diff --git a/netbox/vpn/models/tunnels.py b/netbox/vpn/models/tunnels.py index be1e40142f3..6f4fa4182c6 100644 --- a/netbox/vpn/models/tunnels.py +++ b/netbox/vpn/models/tunnels.py @@ -129,10 +129,10 @@ class TunnelTermination(CustomFieldsMixin, CustomLinksMixin, TagsMixin, ChangeLo ct_field='termination_type', fk_field='termination_id' ) - outside_ip = models.OneToOneField( + outside_ip = models.ForeignKey( to='ipam.IPAddress', on_delete=models.PROTECT, - related_name='tunnel_termination', + related_name='tunnel_terminations', blank=True, null=True )