mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-01-25 08:46:17 +00:00
add routing template field to peer model
This commit is contained in:
20
wireguard/migrations/0028_peer_routing_template.py
Normal file
20
wireguard/migrations/0028_peer_routing_template.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Generated by Django 5.2.9 on 2026-01-22 15:52
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('routing_templates', '0002_routingtemplate_enforce_route_policy'),
|
||||||
|
('wireguard', '0027_alter_wireguardinstance_peer_list_refresh_interval'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='peer',
|
||||||
|
name='routing_template',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='peers', to='routing_templates.routingtemplate'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
from django.core.exceptions import ValidationError
|
|
||||||
from django.db import models
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
NETMASK_CHOICES = (
|
NETMASK_CHOICES = (
|
||||||
(8, '/8 (255.0.0.0)'),
|
(8, '/8 (255.0.0.0)'),
|
||||||
(9, '/9 (255.128.0.0)'),
|
(9, '/9 (255.128.0.0)'),
|
||||||
@@ -82,6 +82,9 @@ class Peer(models.Model):
|
|||||||
persistent_keepalive = models.IntegerField(default=25)
|
persistent_keepalive = models.IntegerField(default=25)
|
||||||
wireguard_instance = models.ForeignKey(WireGuardInstance, on_delete=models.CASCADE)
|
wireguard_instance = models.ForeignKey(WireGuardInstance, on_delete=models.CASCADE)
|
||||||
sort_order = models.IntegerField(default=0)
|
sort_order = models.IntegerField(default=0)
|
||||||
|
routing_template = models.ForeignKey(
|
||||||
|
'routing_templates.RoutingTemplate', on_delete=models.SET_NULL, blank=True, null=True, related_name='peers'
|
||||||
|
)
|
||||||
|
|
||||||
created = models.DateTimeField(auto_now_add=True)
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
updated = models.DateTimeField(auto_now=True)
|
updated = models.DateTimeField(auto_now=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user