Browse Source

Excluse empty-string URLs from icons table

rpm
J. King 4 years ago
parent
commit
8f739cec85
  1. 2
      sql/MySQL/6.sql
  2. 2
      sql/PostgreSQL/6.sql
  3. 2
      sql/SQLite3/6.sql

2
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;

2
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;

2
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

Loading…
Cancel
Save