From 54778a2a813d5488eb7c062ddde02bd21e990247 Mon Sep 17 00:00:00 2001 From: Ehco1996 Date: Sun, 17 Dec 2023 11:16:50 +0800 Subject: [PATCH] db: Update foreign key deletion behavior in usertrafficlog model --- .../proxy/migrations/0005_auto_20210506_1950.py | 4 ++-- ...0020_alter_proxynode_ehco_reload_interval.py | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 apps/proxy/migrations/0020_alter_proxynode_ehco_reload_interval.py diff --git a/apps/proxy/migrations/0005_auto_20210506_1950.py b/apps/proxy/migrations/0005_auto_20210506_1950.py index be9eec1e1d..fdf0a28123 100644 --- a/apps/proxy/migrations/0005_auto_20210506_1950.py +++ b/apps/proxy/migrations/0005_auto_20210506_1950.py @@ -38,7 +38,7 @@ class Migration(migrations.Migration): model_name="usertrafficlog", name="proxy_node", field=models.ForeignKey( - on_delete=django.db.models.deletion.DO_NOTHING, + on_delete=django.db.models.deletion.CASCADE, to="proxy.proxynode", verbose_name="代理节点", ), @@ -48,7 +48,7 @@ class Migration(migrations.Migration): name="user", field=models.ForeignKey( null=True, - on_delete=django.db.models.deletion.DO_NOTHING, + on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name="用户", ), diff --git a/apps/proxy/migrations/0020_alter_proxynode_ehco_reload_interval.py b/apps/proxy/migrations/0020_alter_proxynode_ehco_reload_interval.py new file mode 100644 index 0000000000..c97327c598 --- /dev/null +++ b/apps/proxy/migrations/0020_alter_proxynode_ehco_reload_interval.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.6 on 2023-12-17 03:16 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("proxy", "0019_proxynode_ehco_reload_interval"), + ] + + operations = [ + migrations.AlterField( + model_name="proxynode", + name="ehco_reload_interval", + field=models.IntegerField(default=0, verbose_name="配置重载间隔"), + ), + ]