Skip to content

Commit

Permalink
删除了 to_field 并且合并了迁移文件
Browse files Browse the repository at this point in the history
  • Loading branch information
Deophius authored and pkuGenuine committed Mar 1, 2024
1 parent 93901c9 commit c08ae4f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.0.1 on 2024-01-18 16:49
# Generated by Django 5.0.1 on 2024-02-29 11:08

import django.db.models.deletion
from django.conf import settings
Expand All @@ -12,6 +12,24 @@ class Migration(migrations.Migration):
]

operations = [
migrations.AlterField(
model_name="yqpointrecord",
name="source_type",
field=models.SmallIntegerField(
choices=[
(0, "系统操作"),
(1, "每日签到"),
(2, "参与活动"),
(3, "问题反馈"),
(4, "达成成就"),
(5, "填写问卷"),
(6, "奖池花费"),
(7, "奖池补偿"),
],
default=0,
verbose_name="来源类型",
),
),
migrations.CreateModel(
name="PermissionBlacklist",
fields=[
Expand All @@ -37,7 +55,6 @@ class Migration(migrations.Migration):
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
to_field="username",
verbose_name="用户",
),
),
Expand Down
30 changes: 0 additions & 30 deletions generic/migrations/0003_alter_yqpointrecord_source_type.py

This file was deleted.

1 change: 0 additions & 1 deletion generic/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ class Meta:

user = models.ForeignKey(
User, verbose_name='用户', on_delete=models.CASCADE,
to_field='username',
)
permission = models.ForeignKey(
Permission, verbose_name='权限', on_delete=models.CASCADE,
Expand Down

0 comments on commit c08ae4f

Please sign in to comment.