Browse Source

Fix MySQL schema

microsub
J. King 4 years ago
parent
commit
f4b08170bf
  1. 7
      sql/MySQL/5.sql

7
sql/MySQL/5.sql

@ -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

Loading…
Cancel
Save