Skip to content

Commit

Permalink
*: fix change locations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Dec 17, 2023
1 parent 54778a2 commit 70df177
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/proxy/migrations/0005_auto_20210506_1950.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Migration(migrations.Migration):
model_name="usertrafficlog",
name="proxy_node",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
on_delete=django.db.models.deletion.DO_NOTHING,
to="proxy.proxynode",
verbose_name="代理节点",
),
Expand All @@ -48,7 +48,7 @@ class Migration(migrations.Migration):
name="user",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
on_delete=django.db.models.deletion.DO_NOTHING,
to=settings.AUTH_USER_MODEL,
verbose_name="用户",
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 4.2.6 on 2023-12-17 03:29

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("proxy", "0020_alter_proxynode_ehco_reload_interval"),
]

operations = [
migrations.AlterField(
model_name="usertrafficlog",
name="proxy_node",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="proxy.proxynode",
verbose_name="代理节点",
),
),
migrations.AlterField(
model_name="usertrafficlog",
name="user",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
verbose_name="用户",
),
),
]
4 changes: 2 additions & 2 deletions apps/proxy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,11 +712,11 @@ def remark(self):

class UserTrafficLog(BaseLogModel):
user = models.ForeignKey(
User, on_delete=models.DO_NOTHING, verbose_name="用户", null=True
User, on_delete=models.CASCADE, verbose_name="用户", null=True
)
proxy_node = models.ForeignKey(
ProxyNode,
on_delete=models.DO_NOTHING,
on_delete=models.CASCADE,
verbose_name="代理节点",
)
upload_traffic = models.BigIntegerField("上传流量", default=0)
Expand Down

0 comments on commit 70df177

Please sign in to comment.