perf: 修改 migrations

pull/8931/head
ibuler 2022-09-23 10:53:44 +08:00
parent 3a884388cd
commit 286d0e4ac1
2 changed files with 7 additions and 7 deletions

View File

@ -50,16 +50,16 @@ class Migration(migrations.Migration):
model_name='authbook',
name='systemuser',
),
migrations.DeleteModel(
name='Cluster',
),
migrations.DeleteModel(
name='AdminUser',
),
migrations.DeleteModel(
name='HistoricalAuthBook',
),
migrations.DeleteModel(
name='AuthBook',
),
# migrations.DeleteModel(
# name='AdminUser',
# ),
migrations.DeleteModel(
name='Cluster',
),
]

View File

@ -39,7 +39,7 @@ def migrate_system_to_account(apps, schema_editor):
setattr(obj, new_field, new_value)
updated.append(obj)
model.objects.bulk_update(updated, [new_field])
print("Migrate account: {}-{} using: {:.2f}s".format(
print(" Migrate account: {}-{} using: {:.2f}s".format(
count - len(objects), count, time.time()-start
))