Commit b1336c88 authored by Jens Langhammer's avatar Jens Langhammer

Fix issue where upgrading to 0.5.3 failed because of duplicate primary keys

parent bab11241
Pipeline #3828 failed with stage
in 5 minutes and 53 seconds
......@@ -6,6 +6,12 @@ import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
def clean_serve_rule(apps, schema_editor):
"""Remove ServeRules before upgrading, preventing an issue with pk."""
ServeRule = apps.get_model("p2_serve", "ServeRule")
ServeRule.objects.delete()
class Migration(migrations.Migration):
dependencies = [
......@@ -13,6 +19,7 @@ class Migration(migrations.Migration):
]
operations = [
migrations.RunPython(clean_serve_rule),
migrations.RemoveField(
model_name='serverule',
name='id',
......
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