mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-24 22:12:00 +00:00
perf: 修改名称
This commit is contained in:
parent
8f31a25fda
commit
3a884388cd
@ -31,7 +31,7 @@ def migrate_nodes_full_value(apps, schema_editor):
|
|||||||
model = apps.get_model("assets", "Node")
|
model = apps.get_model("assets", "Node")
|
||||||
db_alias = schema_editor.connection.alias
|
db_alias = schema_editor.connection.alias
|
||||||
nodes = model.objects.using(db_alias).all()
|
nodes = model.objects.using(db_alias).all()
|
||||||
print("- Start migrate node full value")
|
print("\n- Start migrate node full value")
|
||||||
for i, node in enumerate(list(nodes)):
|
for i, node in enumerate(list(nodes)):
|
||||||
print("{} start migrate {} node full value".format(i, node.value))
|
print("{} start migrate {} node full value".format(i, node.value))
|
||||||
ancestor_keys = get_node_ancestor_keys(node.key, True)
|
ancestor_keys = get_node_ancestor_keys(node.key, True)
|
||||||
|
@ -10,12 +10,6 @@ class Migration(migrations.Migration):
|
|||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.DeleteModel(
|
|
||||||
name='AdminUser',
|
|
||||||
),
|
|
||||||
migrations.DeleteModel(
|
|
||||||
name='Cluster',
|
|
||||||
),
|
|
||||||
migrations.RemoveField(
|
migrations.RemoveField(
|
||||||
model_name='historicalauthbook',
|
model_name='historicalauthbook',
|
||||||
name='asset',
|
name='asset',
|
||||||
@ -62,4 +56,10 @@ class Migration(migrations.Migration):
|
|||||||
migrations.DeleteModel(
|
migrations.DeleteModel(
|
||||||
name='AuthBook',
|
name='AuthBook',
|
||||||
),
|
),
|
||||||
|
# migrations.DeleteModel(
|
||||||
|
# name='AdminUser',
|
||||||
|
# ),
|
||||||
|
migrations.DeleteModel(
|
||||||
|
name='Cluster',
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
@ -15,8 +15,9 @@ def migrate_system_to_account(apps, schema_editor):
|
|||||||
(apply_login_asset_ticket_model, 'apply_login_system_user', 'apply_login_account', False),
|
(apply_login_asset_ticket_model, 'apply_login_system_user', 'apply_login_account', False),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
print("\nStart migrate system user to account")
|
||||||
for model, old_field, new_field, m2m in model_system_user_account:
|
for model, old_field, new_field, m2m in model_system_user_account:
|
||||||
print("Start migrate '{}' system user to account".format(model.__name__))
|
print(" - migrate '{}'".format(model.__name__))
|
||||||
count = 0
|
count = 0
|
||||||
bulk_size = 1000
|
bulk_size = 1000
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user