#112 Migration enhance

* fixes bug in migration
* adds check to migration which raises error before data loss might happen
pull/115/head
mpeltriaux 3 years ago
parent 2b66189590
commit afb78fa670

@ -9,9 +9,12 @@ def migrate_actions(apps, schema_editor):
for action in actions: for action in actions:
action_type = action.action_type or [] action_type = action.action_type or []
action.action_type_tmp.set(action_type) action.action_type_tmp.set([action_type])
action.save() action.save()
if not action.action_type_tmp.count() > 0:
raise ValueError("Migration of actions did not work! Stoped before data loss!")
class Migration(migrations.Migration): class Migration(migrations.Migration):

Loading…
Cancel
Save