perf: 优化数据迁移,性能提升50倍

pull/6967/head
ibuler 3 years ago committed by Jiangjie.Bai
parent e1eef0a3f3
commit 456116938d

@ -15,7 +15,7 @@ def migrate_system_assets_to_authbook(apps, schema_editor):
system_users = system_user_model.objects.all()
for s in system_users:
while True:
systemuser_asset_relations = system_user_asset_model.objects.filter(systemuser=s)[:20]
systemuser_asset_relations = system_user_asset_model.objects.filter(systemuser=s)[:1000]
if not systemuser_asset_relations:
break
authbooks = []

Loading…
Cancel
Save