mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-12 13:56:46 +00:00
Update migrations/2024-12-02-181601_add_report_combined_table/up.sql
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
This commit is contained in:
parent
fa31fc37d0
commit
10f5e373cf
|
@ -15,23 +15,27 @@ CREATE INDEX idx_report_combined_published ON report_combined (published DESC, i
|
||||||
CREATE INDEX idx_report_combined_published_asc ON report_combined (reverse_timestamp_sort (published) DESC, id DESC);
|
CREATE INDEX idx_report_combined_published_asc ON report_combined (reverse_timestamp_sort (published) DESC, id DESC);
|
||||||
|
|
||||||
-- Updating the history
|
-- Updating the history
|
||||||
INSERT INTO report_combined (published, post_report_id)
|
INSERT INTO report_combined (published, post_report_id, comment_report_id, private_message_report_id)
|
||||||
SELECT
|
SELECT
|
||||||
published,
|
published,
|
||||||
id
|
id,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
FROM
|
FROM
|
||||||
post_report;
|
post_report
|
||||||
|
UNION ALL
|
||||||
INSERT INTO report_combined (published, comment_report_id)
|
|
||||||
SELECT
|
SELECT
|
||||||
published,
|
published,
|
||||||
id
|
NULL,
|
||||||
|
id,
|
||||||
|
NULL
|
||||||
FROM
|
FROM
|
||||||
comment_report;
|
comment_report
|
||||||
|
UNION ALL
|
||||||
INSERT INTO report_combined (published, private_message_report_id)
|
|
||||||
SELECT
|
SELECT
|
||||||
published,
|
published,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
id
|
id
|
||||||
FROM
|
FROM
|
||||||
private_message_report;
|
private_message_report;
|
||||||
|
|
Loading…
Reference in a new issue