From 9e0b582beaa6961fca749d1cf3f5debb7428ce8d Mon Sep 17 00:00:00 2001 From: Marcel Kornblum Date: Fri, 24 Nov 2023 17:32:05 +0000 Subject: [PATCH] Fix e2e tests (#520) added a migration to kill waffle tables causing unmanaged postgres dependencies --- .../0005_fix_waffle_truncate_issue.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/core/migrations/0005_fix_waffle_truncate_issue.py diff --git a/src/core/migrations/0005_fix_waffle_truncate_issue.py b/src/core/migrations/0005_fix_waffle_truncate_issue.py new file mode 100644 index 000000000..bac0f1d14 --- /dev/null +++ b/src/core/migrations/0005_fix_waffle_truncate_issue.py @@ -0,0 +1,18 @@ +from django.db import migrations + + +class Migration(migrations.Migration): + """ + Migration for issue: cannot truncate a table referenced in a foreign key constraint: Table "waffle_flag_groups" references "auth_group". + See more: https://github.com/django-waffle/django-waffle/issues/317#issuecomment-488398832 + """ + + dependencies = [ + ("core", "0004_featureflag"), + ("waffle", "__latest__"), + ] + + operations = [ + migrations.RunSQL("DROP TABLE IF EXISTS waffle_flag_groups"), + migrations.RunSQL("DROP TABLE IF EXISTS waffle_flag_users"), + ]