Skip to content

Commit

Permalink
Fixes #14706: Relax one-to-one mapping of tunnel termination to IP ad…
Browse files Browse the repository at this point in the history
…dress
  • Loading branch information
jeremystretch committed Jan 8, 2024
1 parent 5223486 commit e1e198e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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'),
),
]
4 changes: 2 additions & 2 deletions netbox/vpn/models/tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit e1e198e

Please sign in to comment.