Keep status as a single field
This commit is contained in:
parent
0cc2bc269e
commit
a9a2da0957
2 changed files with 17 additions and 28 deletions
|
@ -35,13 +35,6 @@ class Migration(migrations.Migration):
|
|||
name="related_reports",
|
||||
field=models.ManyToManyField(to="bookwyrm.Report"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="notification",
|
||||
name="related_statuses",
|
||||
field=models.ManyToManyField(
|
||||
related_name="notifications", to="bookwyrm.Status"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="notification",
|
||||
name="related_users",
|
||||
|
@ -81,11 +74,6 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
migrations.RunSQL(
|
||||
sql="""
|
||||
INSERT INTO bookwyrm_notification_related_statuses (notification_id, status_id)
|
||||
SELECT id, related_status_id
|
||||
FROM bookwyrm_notification
|
||||
WHERE bookwyrm_notification.related_status_id IS NOT NULL;
|
||||
|
||||
INSERT INTO bookwyrm_notification_related_users (notification_id, user_id)
|
||||
SELECT id, related_user_id
|
||||
FROM bookwyrm_notification
|
||||
|
@ -121,10 +109,6 @@ class Migration(migrations.Migration):
|
|||
model_name="notification",
|
||||
name="related_report",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="notification",
|
||||
name="related_status",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="notification",
|
||||
name="related_user",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue