Skip to content

Commit

Permalink
Version 1.0.193
Browse files Browse the repository at this point in the history
  • Loading branch information
einar-saukas committed May 4, 2024
1 parent 6c56f97 commit 1129696
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Binary file modified ZXDB_mysql.sql.zip
Binary file not shown.
6 changes: 4 additions & 2 deletions scripts/07-ZXDB_import_lemon64.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ left join ports p on p.entry_id = e.id and p.platform_id = 7 and p.link_system =
where p.id is null order by e.id;

-- List mutual links stored in ZXDB but not in lemon64 (except never released titles)
select * from entries e
select e.id as zxdb_id,e.title as spectrum_title,coalesce(p.title,e.title) as c64_title,p.link_system
from entries e
inner join ports p on p.entry_id = e.id and p.platform_id = 7
left join tmp_lemon x on e.id = x.entry_id and p.link_system = x.lemon_link
where p.link_system like 'https://www.lemon64.com/%'
Expand All @@ -56,9 +57,10 @@ and x.lemon_id is null
order by e.title;

-- List of ZXDB titles missing links to corresponding C64 titles
select e.id,e.title,GROUP_CONCAT(b.name ORDER BY k.publisher_seq SEPARATOR ' / ') as publishers
select e.id,e.title,GROUP_CONCAT(b.name ORDER BY k.publisher_seq SEPARATOR ' / ') as publishers,g.text as genre
from entries e
inner join ports p on p.entry_id = e.id and p.platform_id = 7
left join genretypes g on e.genretype_id = g.id
left join publishers k on k.entry_id = e.id and k.release_seq = 0
left join labels b on k.label_id = b.id
where coalesce(e.genretype_id,0) < 80
Expand Down
8 changes: 5 additions & 3 deletions scripts/08-ZXDB_import_amiga.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ left join ports p on p.entry_id = e.id and p.platform_id = 19 and p.link_system
where p.id is null;

-- List mutual links stored in ZXDB but not in lemonamiga (except never released titles)
select * from entries e
select e.id as zxdb_id,e.title as spectrum_title,coalesce(p.title,e.title) as amiga_title,p.link_system
from entries e
inner join ports p on p.entry_id = e.id and p.platform_id = 19
left join tmp_amiga x on e.id = x.entry_id and p.link_system = x.lemon_link
where p.link_system like 'https://www.lemonamiga.com/%'
and (coalesce(e.availabletype_id,'') <> 'N' or e.id in (select entry_id from downloads where filetype_id in (8,10,11)))
and x.lemon_id is null;

-- List elsewhere links stored in ZXDB that don't exist in lemon64 (except never released titles)
-- List elsewhere links stored in ZXDB that don't exist in lemonamiga (except never released titles)
select * from entries e
inner join ports p on p.entry_id = e.id and p.platform_id = 19
left join tmp_amiga x on e.id = x.entry_id
Expand All @@ -57,9 +58,10 @@ and x.lemon_id is null
order by e.title;

-- List of ZXDB titles missing links to corresponding Amiga titles
select e.id,e.title,GROUP_CONCAT(b.name ORDER BY k.publisher_seq SEPARATOR ' / ') as publishers
select e.id,e.title,GROUP_CONCAT(b.name ORDER BY k.publisher_seq SEPARATOR ' / ') as publishers,g.text as genre
from entries e
inner join ports p on p.entry_id = e.id and p.platform_id = 19
left join genretypes g on e.genretype_id = g.id
left join publishers k on k.entry_id = e.id and k.release_seq = 0
left join labels b on k.label_id = b.id
where coalesce(e.genretype_id,0) < 80
Expand Down
2 changes: 1 addition & 1 deletion scripts/ZXDB_help_search.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ create table search_by_titles (
index (entry_id)
);

insert into search_by_titles (entry_title, entry_id) (select replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(lower(title),' ',''),'-' ,''),'.' ,''),',' ,''),'"' ,''),'''' ,''),'/' ,''),':' ,''),'!' ,''),'[sam]' ,''),'[' ,''),']' ,'') as tt, eid from (select id as eid, title from entries union all select id as eid, replace(title,' II', ' 2') from entries where title REGEXP ' II[ ,:+]' or title like '% II' union all select id as eid, replace(title,' III', ' 3') from entries where title REGEXP ' III[ ,:+]' or title like '% III' union all select id as eid, replace(title,' IV', ' 4') from entries where title REGEXP ' IV[ ,:+]' or title like '% IV' union all select id as eid, replace(title,' V', ' 5') from entries where title REGEXP ' V[ ,:+]' or title like '% V' union all select id as eid, replace(title,' VI', ' 6') from entries where title REGEXP ' VI[ ,:+]' or title like '% VI' union all select id as eid, replace(title,' VII', ' 7') from entries where title REGEXP ' VII[ ,:+]' or title like '% VII' union all select id as eid, replace(title,' VIII', ' 8') from entries where title REGEXP ' VIII[ ,:+]' or title like '% VIII' union all select entry_id as eid, title from aliases union all select entry_id as eid, replace(title,' II', ' 2') from aliases where title REGEXP ' II[ ,:+]' or title like '% II' union all select entry_id as eid, replace(title,' III', ' 3') from aliases where title REGEXP ' III[ ,:+]' or title like '% III' union all select entry_id as eid, replace(title,' IV', ' 4') from aliases where title REGEXP ' IV[ ,:+]' or title like '% IV' union all select entry_id as eid, replace(title,' V', ' 5') from aliases where title REGEXP ' V[ ,:+]' or title like '% V' union all select entry_id as eid, replace(title,' VI', ' 6') from aliases where title REGEXP ' VI[ ,:+]' or title like '% VI' union all select entry_id as eid, replace(title,' VII', ' 7') from aliases where title REGEXP ' VII[ ,:+]' or title like '% VII' union all select entry_id as eid, replace(title,' VIII', ' 8') from aliases where title REGEXP ' VIII[ ,:+]' or title like '% VIII' union all select entry_id as eid, alias as title from contents where alias is not null and entry_id is not null) as x group by tt collate utf8_unicode_ci, eid order by tt, eid);
insert into search_by_titles (entry_title, entry_id) (select replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(lower(title),' ',''),'-' ,''),'.' ,''),',' ,''),'"' ,''),'''' ,''),'/' ,''),':' ,''),'!' ,''),'[sam]' ,''),'[' ,''),']' ,'') as tt, eid from (select id as eid, title from entries union all select id as eid, replace(title,' II', ' 2') from entries where title REGEXP ' II[ ,:+]' or title like '% II' union all select id as eid, replace(title,' III', ' 3') from entries where title REGEXP ' III[ ,:+]' or title like '% III' union all select id as eid, replace(title,' IV', ' 4') from entries where title REGEXP ' IV[ ,:+]' or title like '% IV' union all select id as eid, replace(title,' V', ' 5') from entries where title REGEXP ' V[ ,:+]' or title like '% V' union all select id as eid, replace(title,' VI', ' 6') from entries where title REGEXP ' VI[ ,:+]' or title like '% VI' union all select id as eid, replace(title,' VII', ' 7') from entries where title REGEXP ' VII[ ,:+]' or title like '% VII' union all select id as eid, replace(title,' VIII', ' 8') from entries where title REGEXP ' VIII[ ,:+]' or title like '% VIII' union all select entry_id as eid, title from aliases union all select entry_id as eid, replace(title,' II', ' 2') from aliases where title REGEXP ' II[ ,:+]' or title like '% II' union all select entry_id as eid, replace(title,' III', ' 3') from aliases where title REGEXP ' III[ ,:+]' or title like '% III' union all select entry_id as eid, replace(title,' IV', ' 4') from aliases where title REGEXP ' IV[ ,:+]' or title like '% IV' union all select entry_id as eid, replace(title,' V', ' 5') from aliases where title REGEXP ' V[ ,:+]' or title like '% V' union all select entry_id as eid, replace(title,' VI', ' 6') from aliases where title REGEXP ' VI[ ,:+]' or title like '% VI' union all select entry_id as eid, replace(title,' VII', ' 7') from aliases where title REGEXP ' VII[ ,:+]' or title like '% VII' union all select entry_id as eid, replace(title,' VIII', ' 8') from aliases where title REGEXP ' VIII[ ,:+]' or title like '% VIII' union all select entry_id as eid, alias as title from contents where alias is not null and entry_id is not null union all select container_id as eid, alias as title from contents where alias is not null and entry_id is null) as x group by tt collate utf8_unicode_ci, eid order by tt, eid);


-- Help search for labels (individuals or companies) by name (in lower case without space or punctuation)
Expand Down

0 comments on commit 1129696

Please sign in to comment.