diff --git a/babybuddy/migrations/0024_auto_20221023_0759.py b/babybuddy/migrations/0025_auto_20221023_0821.py similarity index 84% rename from babybuddy/migrations/0024_auto_20221023_0759.py rename to babybuddy/migrations/0025_auto_20221023_0821.py index a9345f75..936ff547 100644 --- a/babybuddy/migrations/0024_auto_20221023_0759.py +++ b/babybuddy/migrations/0025_auto_20221023_0821.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.2 on 2022-10-23 07:59 +# Generated by Django 4.1.2 on 2022-10-23 08:21 from django.db import migrations from django.contrib.auth.models import Group, Permission @@ -60,10 +60,19 @@ def add_group_permissions(apps, schema_editor): group.permissions.add(*perm) +def revert_migration(apps, schema_editor): + Group.objects.filter( + name__in=[ + "read_only", + "standard", + ] + ).delete() + + class Migration(migrations.Migration): dependencies = [ ("babybuddy", "0023_alter_settings_timezone"), ] - operations = [migrations.RunPython(add_group_permissions)] + operations = [migrations.RunPython(add_group_permissions, revert_migration)]