Skip to content

Commit cfa8080

Browse files
committed
chore: update migration to alter systemsetting type and remove duplicates
1 parent 85d6a26 commit cfa8080

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

apps/system_manage/migrations/0004_alter_systemsetting_type_and_more.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Generated by Django 5.2.7 on 2025-10-16 03:21
22

3-
from django.db import migrations
3+
from django.db import migrations, models
44
from django.db.models.functions import RowNumber
55

66

@@ -20,18 +20,23 @@ def remove_duplicates(apps, schema_editor):
2020
if ids_to_delete:
2121
workspace_user_resource_permission_model.objects.filter(id__in=ids_to_delete).delete()
2222

23-
class Migration(migrations.Migration):
2423

24+
class Migration(migrations.Migration):
2525
dependencies = [
2626
('system_manage', '0003_alter_workspaceuserresourcepermission_target'),
2727
('users', '0001_initial'),
2828
]
2929

3030
operations = [
31-
migrations.RunPython(remove_duplicates,
32-
),
31+
migrations.RunPython(remove_duplicates),
3332
migrations.AlterUniqueTogether(
3433
name='workspaceuserresourcepermission',
3534
unique_together={('workspace_id', 'user', 'auth_target_type', 'target')},
3635
),
36+
migrations.AlterField(
37+
model_name='systemsetting',
38+
name='type',
39+
field=models.IntegerField(choices=[(0, '邮箱'), (1, '私钥秘钥'), (2, '日志清理时间')], default=0,
40+
primary_key=True, serialize=False, verbose_name='设置类型'),
41+
),
3742
]

0 commit comments

Comments
 (0)