-
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
1,268 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Generated by Django 3.2.13 on 2022-07-05 00:49 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("bookwyrm", "0150_readthrough_stopped_date"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="notification", | ||
name="related_book", | ||
), | ||
migrations.AddField( | ||
model_name="notification", | ||
name="related_list_items", | ||
field=models.ManyToManyField( | ||
related_name="notifications", to="bookwyrm.ListItem" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="notification", | ||
name="related_reports", | ||
field=models.ManyToManyField(to="bookwyrm.Report"), | ||
), | ||
migrations.AddField( | ||
model_name="notification", | ||
name="related_users", | ||
field=models.ManyToManyField( | ||
related_name="notifications", to=settings.AUTH_USER_MODEL | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="notification", | ||
name="related_list_item", | ||
field=models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="notifications_tmp", | ||
to="bookwyrm.listitem", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="notification", | ||
name="related_report", | ||
field=models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="notifications_tmp", | ||
to="bookwyrm.report", | ||
), | ||
), | ||
migrations.RunSQL( | ||
sql=""" | ||
INSERT INTO bookwyrm_notification_related_users (notification_id, user_id) | ||
SELECT id, related_user_id | ||
FROM bookwyrm_notification | ||
WHERE bookwyrm_notification.related_user_id IS NOT NULL; | ||
INSERT INTO bookwyrm_notification_related_list_items (notification_id, listitem_id) | ||
SELECT id, related_list_item_id | ||
FROM bookwyrm_notification | ||
WHERE bookwyrm_notification.related_list_item_id IS NOT NULL; | ||
INSERT INTO bookwyrm_notification_related_reports (notification_id, report_id) | ||
SELECT id, related_report_id | ||
FROM bookwyrm_notification | ||
WHERE bookwyrm_notification.related_report_id IS NOT NULL; | ||
""", | ||
reverse_sql=migrations.RunSQL.noop, | ||
), | ||
migrations.RemoveField( | ||
model_name="notification", | ||
name="related_list_item", | ||
), | ||
migrations.RemoveField( | ||
model_name="notification", | ||
name="related_report", | ||
), | ||
migrations.RemoveField( | ||
model_name="notification", | ||
name="related_user", | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
bookwyrm/migrations/0152_remove_notification_notification_type_valid.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 3.2.13 on 2022-07-05 03:16 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("bookwyrm", "0151_auto_20220705_0049"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveConstraint( | ||
model_name="notification", | ||
name="notification_type_valid", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Generated by Django 3.2.13 on 2022-07-06 21:41 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("bookwyrm", "0152_alter_report_user"), | ||
("bookwyrm", "0152_remove_notification_notification_type_valid"), | ||
] | ||
|
||
operations = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.