Skip to content

Commit

Permalink
Truncate the syncqueue table before we add the unique constraint.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed May 22, 2024
1 parent a5ec048 commit 091dda1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kolibri/core/device/migrations/0019_syncqueue_and_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import django.db.models.deletion
import morango.models.fields.uuids
from django.conf import settings
from django.db import connection
from django.db import migrations
from django.db import models

Expand All @@ -20,6 +20,13 @@ class Migration(migrations.Migration):
model_name="usersyncstatus",
name="queued",
),
migrations.RunSQL(
[
"DELETE FROM device_syncqueue;"
if "sqlite" in connection.vendor
else "TRUNCATE TABLE device_syncqueue;"
]
),
migrations.AddField(
model_name="syncqueue",
name="attempts",
Expand Down

0 comments on commit 091dda1

Please sign in to comment.