Commit 8dfdefd4 authored by ibuler's avatar ibuler

[Update] 更新迁移脚本

parent ee4f5a81
......@@ -3,6 +3,7 @@
python ../apps/manage.py shell << EOF
from perms.models import *
from assets.models import SystemUser
for old in NodePermission.objects.all():
perm = AssetPermission.objects.create(
......@@ -20,5 +21,10 @@ for old in NodePermission.objects.all():
perm.user_groups.add(old.user_group)
perm.nodes.add(old.node)
perm.system_users.add(old.system_user)
for s in SystemUser.objects.all():
nodes = list(s.nodes.all())
s.nodes.set([])
s.nodes.set(nodes)
EOF
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment