1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 13:12:41 +00:00

Fix MySQL schema

This commit is contained in:
J. King 2019-12-02 16:38:41 -05:00
parent 568e6e4660
commit f4b08170bf

View file

@ -9,9 +9,10 @@ alter table arsse_sessions default character set utf8mb4 collate utf8mb4_unicode
alter table arsse_sessions convert to character set utf8mb4 collate utf8mb4_unicode_ci;
-- Ensure referential integrity
delete from arsse_folders where
owner not in (select id from arsse_users) or
(parent is not null and parent not in (select id from arsse_folders));
with valid as (select id from arsse_folders)
delete from arsse_folders where
owner not in (select id from arsse_users) or
(parent is not null and parent not in (select id from valid));
delete from arsse_subscriptions where
owner not in (select id from arsse_users) or
feed not in (select id from arsse_feeds) or