Skip to content

Commit

Permalink
Version 1.0.167
Browse files Browse the repository at this point in the history
  • Loading branch information
einar-saukas committed Aug 8, 2023
1 parent 25899af commit a9bcc35
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 15 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For further details, visit the [ZXDB forum section](https://spectrumcomputing.co

Simply download the latest database content, then load it into MySQL/MariaDB:

* `ZXDB_mysql.sql` - The latest complete ZXDB database script for MySQL/MariaDB. That's all you really need!
* `ZXDB_mysql.sql.zip` - The latest complete ZXDB database script for MySQL/MariaDB. That's all you really need!

Optionally you can execute one of the provided scripts to convert file `ZXDB_mysql.sql` above to a different RDBMS:

Expand All @@ -21,18 +21,14 @@ Optionally you can execute one of the provided scripts to convert file `ZXDB_mys

* `scripts/ZXDB_to_generic.groovy` - Groovy script to convert ZXDB into a (more) generic SQL

The ZXDB distribution already includes all links to [RZX Archive](http://www.rzxarchive.co.uk/), but these links can also be updated independently. There's a separate script to import these links into ZXDB:

* `scripts/ZXDB_import_rzx.sql` - Script to import [RZX Archive](http://www.rzxarchive.co.uk/) links from file [RZXArchiveZXDB.txt](https://spectrumcomputing.co.uk/RZXArchiveZXDB.txt)

The ZXDB distribution already includes all links to [Speccy Screenshot Maps](http://maps.speccy.cz/), but these links can also be updated independently. There's another separate script to import these links into ZXDB:

* `scripts/ZXDB_import_mapy.sql` - Script to import [Speccy Screenshot Maps](http://maps.speccy.cz/) links from file [mapy.txt](https://maps.speccy.cz/mapy.txt)

There's also an optional script to create auxiliary tables, that can be used to help database searches. Ideally these tables must be repopulated whenever ZXDB content changes, or defined as materialized views in a RDBMS that supports it:

* `scripts/ZXDB_help_search.sql` - Script to create auxiliary tables prefixed with `search_by_`

The ZXDB distribution already includes links and references to integrated sites like [Speccy Screenshot Maps](http://maps.speccy.cz/) and [ZX-Spectrum Reviews (ZXSR)](http://zxspectrumreviews.co.uk/), but this information can also be updated independently. There are separate scripts to reimport them into ZXDB:

* `scripts/*-ZXDB_import_*.sql` - Scripts to reimport information from integrated sites (additional details are explained in each file)

Finally there's a script for health checking, that validates ZXDB consistency rules that cannot be enforced by check constraints:

* `scripts/ZXDB_health_check.sql` - Script to identify data inconsistencies in ZXDB
Expand Down
Binary file modified ZXDB_mysql.sql.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- [ZXDB] Import into ZXDB some data from Demozoo.
-- The latest Demozoo database dump is available at https://demozoo.org/pages/faq/
-- The latest Demozoo database dump is available for download at https://demozoo.org/pages/faq/
-- by Einar Saukas

USE zxdb;
Expand Down Expand Up @@ -32,7 +32,7 @@ order by name;
-- Categories from Demozoo not in ZXDB
select concat('(''',category,'''),') as 'insert into categories(text) values'
from (
select replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(c.name,'CAFePARTY 2019 Invitations','Invitation'),' Tiny Intro (256b)',' 256b Intro'),' Intro 256B',' 256b Intro'),' Intro 4KB',' 4K Intro'),'640k ','640K '),' Byte ','b '),'Kb ','K '),'kb ','K '),'1k','1K'),'4k','4K'),'8-bit - ','8Bit '),'8-bit ','8Bit '),'8bit','8Bit'),' plattform ',' Platform '),' intro',' Intro'),'Oldskool demo','Oldskool Demo'),'(normal results)',''),'(alternative results)','') as category
select replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(c.name,'CAFePARTY 2019 Invitations','Invitation'),' Tiny Intro (256b)',' 256b Intro'),' Intro 256B',' 256b Intro'),' Intro 4KB',' 4K Intro'),'640k ','640K '),' Byte ','b '),'Kb ','K '),'kb ','K '),'1k','1K'),'4k','4K'),'8-bit - ','8Bit '),'8-bit ','8Bit '),'8bit','8Bit'),' plattform ',' Platform '),' intro',' Intro'),' demo',' Demo'),'(normal results)',''),'(alternative results)','') as category
from zxdb.entries e
inner join zxdb.webrefs w on w.entry_id = e.id and w.website_id = 48
inner join public.productions_production p on p.id = replace(replace(w.link,'https://demozoo.org/productions/',''),'/','')
Expand All @@ -53,7 +53,7 @@ inner join public.parties_competitionplacing n on p.id = n.production_id
inner join public.parties_competition c on n.competition_id = c.id
inner join public.parties_party y on c.party_id = y.id
inner join zxdb.tags t on t.name = y.name
inner join zxdb.categories g on g.text = replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(c.name,'CAFePARTY 2019 Invitations','Invitation'),' Tiny Intro (256b)',' 256b Intro'),' Intro 256B',' 256b Intro'),' Intro 4KB',' 4K Intro'),'640k ','640K '),' Byte ','b '),'Kb ','K '),'kb ','K '),'1k','1K'),'4k','4K'),'8-bit - ','8Bit '),'8-bit ','8Bit '),'8bit','8Bit'),' plattform ',' Platform '),' intro',' Intro'),'Oldskool demo','Oldskool Demo'),'(normal results)',''),'(alternative results)','')
inner join zxdb.categories g on g.text = replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(c.name,'CAFePARTY 2019 Invitations','Invitation'),' Tiny Intro (256b)',' 256b Intro'),' Intro 256B',' 256b Intro'),' Intro 4KB',' 4K Intro'),'640k ','640K '),' Byte ','b '),'Kb ','K '),'kb ','K '),'1k','1K'),'4k','4K'),'8-bit - ','8Bit '),'8-bit ','8Bit '),'8bit','8Bit'),' plattform ',' Platform '),' intro',' Intro'),' demo',' Demo'),'(normal results)',''),'(alternative results)','')
left join zxdb.members m on m.tag_id = t.id and m.entry_id = e.id and m.category_id = g.id
where m.tag_id is null and t.id not in (30046)
union all
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions scripts/ZXDB_health_check.sql
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ select * from (
select e.id,e.title,t.text,'game editor for unidentified game' from entries e inner join genretypes t on e.genretype_id = t.id where e.genretype_id = 53 and e.id not in (select entry_id from relations where relationtype_id = 'e')
union all
select e.id,e.title,r.link,'mismatching web link' from entries e inner join webrefs r on r.entry_id = e.id inner join websites w on r.website_id = w.id where not (
r.link like concat(w.link,'%') or (r.website_id=10 and r.link like 'https://%.wikipedia.org/wiki/%') or (r.website_id in (16,19,36,37) and r.link like 'https://youtu.be/%') or (r.website_id in (16,19) and r.link like 'https://www.youtube.com/%') or (r.website_id=31 and r.link like 'https://%.itch.io/%'))
r.link like concat(w.link,'%') or (r.website_id=10 and r.link like 'https://%.wikipedia.org/wiki/%') or (r.website_id in (16,19,36,37) and r.link like 'https://youtu.be/%') or (r.website_id in (16,19,47) and r.link like 'https://www.youtube.com/%') or (r.website_id=31 and r.link like 'https://%.itch.io/%'))
union all
select e.id,e.title,concat(coalesce(r.release_year,'-'),'/',coalesce(r.release_month,'-'),'/',coalesce(r.release_day,'-'),' vs ',coalesce(i.date_year,'-'),'/',coalesce(i.date_month,'-'),'/',coalesce(i.date_day,'-')),'conflicting original publication date between tape and magazine' from entries e inner join releases r on r.entry_id = e.id and r.release_seq = 0 inner join issues i on i.id = e.issue_id where e.genretype_id <> 81 and e.id not in (select entry_id from contents where is_original=1) and e.id not in (select entry_id from booktypeins where is_original=1) and e.id not in (select entry_id from magrefs where is_original=1) and (coalesce(r.release_year,-1) <> coalesce(i.date_year,-1) or coalesce(r.release_month,-1) <> coalesce(i.date_month,-1) or coalesce(r.release_day,-1) <> coalesce(i.date_day,-1))
union all
Expand Down Expand Up @@ -213,8 +213,6 @@ select * from (
select null,null,file_link,'file to be identified and moved to table "downloads"' from files where label_id is null and issue_id is null and tool_id is null and (file_link like '/pub/sinclair/books-pics/%' or file_link like '/pub/sinclair/games-%' or file_link like '/pub/sinclair/hardware-%' or file_link like '/pub/sinclair/slt/%' or file_link like '/pub/sinclair/technical-%' or file_link like '/pub/sinclair/zx81/%')
union all
select null,null,m.name,'label and magazine with same name' from magazines m inner join labels b on m.name = b.name where b.name not in ('48K','Gamestar','Kiddisoft','Maximum')
union all
select e.id,e.title,group_concat(b.name order by p.publisher_seq separator ' / '),'scene demo without Demozoo link' from entries e inner join publishers p on p.entry_id = e.id and p.release_seq = 0 inner join labels b on p.label_id = b.id where e.genretype_id = 79 and e.id not in (select entry_id from webrefs where website_id = 48) group by e.id
) as warnings
order by entry_id, details;

Expand Down

0 comments on commit a9bcc35

Please sign in to comment.