From 8f739cec85cdb673dadd07c286114cb86967189a Mon Sep 17 00:00:00 2001 From: "J. King" Date: Fri, 6 Nov 2020 10:28:28 -0500 Subject: [PATCH] Excluse empty-string URLs from icons table --- sql/MySQL/6.sql | 2 +- sql/PostgreSQL/6.sql | 2 +- sql/SQLite3/6.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/MySQL/6.sql b/sql/MySQL/6.sql index 281467e..4d7d4ae 100644 --- a/sql/MySQL/6.sql +++ b/sql/MySQL/6.sql @@ -30,7 +30,7 @@ create table arsse_icons( type text, data longblob ) character set utf8mb4 collate utf8mb4_unicode_ci; -insert into arsse_icons(url) select distinct favicon from arsse_feeds where favicon is not null; +insert into arsse_icons(url) select distinct favicon from arsse_feeds where favicon is not null and favicon <> ''; alter table arsse_feeds add column icon bigint unsigned; alter table arsse_feeds add constraint foreign key (icon) references arsse_icons(id) on delete set null; update arsse_feeds as f, arsse_icons as i set f.icon = i.id where f.favicon = i.url; diff --git a/sql/PostgreSQL/6.sql b/sql/PostgreSQL/6.sql index 6c128a0..c78f6d4 100644 --- a/sql/PostgreSQL/6.sql +++ b/sql/PostgreSQL/6.sql @@ -31,7 +31,7 @@ create table arsse_icons( type text, data bytea ); -insert into arsse_icons(url) select distinct favicon from arsse_feeds where favicon is not null; +insert into arsse_icons(url) select distinct favicon from arsse_feeds where favicon is not null and favicon <> ''; alter table arsse_feeds add column icon bigint references arsse_icons(id) on delete set null; update arsse_feeds as f set icon = i.id from arsse_icons as i where f.favicon = i.url; alter table arsse_feeds drop column favicon; diff --git a/sql/SQLite3/6.sql b/sql/SQLite3/6.sql index 513422d..6e8a993 100644 --- a/sql/SQLite3/6.sql +++ b/sql/SQLite3/6.sql @@ -40,7 +40,7 @@ create table arsse_icons( type text, -- the Content-Type of the icon, if known data blob -- the binary data of the icon itself ); -insert into arsse_icons(url) select distinct favicon from arsse_feeds where favicon is not null; +insert into arsse_icons(url) select distinct favicon from arsse_feeds where favicon is not null and favicon <> ''; create table arsse_feeds_new( -- newsfeeds, deduplicated -- users have subscriptions to these feeds in another table