mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-15 23:08:20 +00:00
refactor: ConnectionToken 修改表字段名称 account -> account_username
This commit is contained in:
@@ -16,9 +16,9 @@ def migrate_system_user_to_account(apps, schema_editor):
|
||||
count += len(connection_tokens)
|
||||
updated = []
|
||||
for connection_token in connection_tokens:
|
||||
connection_token.account = connection_token.system_user.username
|
||||
connection_token.account_username = connection_token.system_user.username
|
||||
updated.append(connection_token)
|
||||
connection_token_model.objects.bulk_update(updated, ['account'])
|
||||
connection_token_model.objects.bulk_update(updated, ['account_username'])
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -42,7 +42,7 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='connectiontoken',
|
||||
name='account',
|
||||
name='account_username',
|
||||
field=models.CharField(default='', max_length=128, verbose_name='Account'),
|
||||
),
|
||||
migrations.RunPython(migrate_system_user_to_account),
|
||||
|
Reference in New Issue
Block a user