From: Banana Date: Sun, 18 Jul 2021 11:51:43 +0000 (+0200) Subject: update.sql fixes and a new field X-Git-Tag: 1.3~23 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=1ee66c4ab1e258d4aa72985a34abb13c893b3e58;p=bibliotheca-php.git update.sql fixes and a new field --- diff --git a/CHANGELOG b/CHANGELOG index b04344e..997d6f0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ 1.x - Rrajigar Mine + * Fixed install sql file. 1.2 - NyLeve's Falls 20210717 * Updated requirements information diff --git a/documentation/fields.txt b/documentation/fields.txt index 7a56bab..cbb2d77 100644 --- a/documentation/fields.txt +++ b/documentation/fields.txt @@ -1,5 +1,3 @@ -TBD - Bibliotheca provides a set of fields which can be used to define which data an entry in your collection can be saved. Those field definitions are stored in the DB itself and can currently only managed there. But only of @@ -50,3 +48,9 @@ The value which is displayed as a selection for the user. Needed for a selection apiinfo Text description what type of data the api expects if you want to fill this field. + + +# Fieldmigration +Here is an example to migrate a single text field into a lookupmultiple +INSERT INTO bib_collection_entry2lookup_3 (`fk_field`,`fk_entry`,`value`) SELECT '32',`id`,`artist` FROM `bib_collection_entry_3` WHERE `artist` <> ''; +The 32 is the ID from the target field. diff --git a/documentation/setup/bibliotheca.sql b/documentation/setup/bibliotheca.sql index b509ce3..aa63575 100644 --- a/documentation/setup/bibliotheca.sql +++ b/documentation/setup/bibliotheca.sql @@ -119,7 +119,7 @@ CREATE TABLE `#REPLACEME#_sys_fields` ( `type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `searchtype` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `createstring` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `inputValidation` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `inputValidation` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, `apiinfo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -134,31 +134,36 @@ CREATE TABLE `#REPLACEME#_sys_fields` ( -- Dumping data for table `#REPLACEME#_sys_fields` -- -INSERT INTO `#REPLACEME#_sys_fields` (`id`, `identifier`, `displayname`, `type`, `searchtype`, `createstring`, `inputValidation`, `value`, `apiinfo`, `created`, `modificationuser`, `owner`, `group`, `rights`) VALUES -(1, 'title', 'Title', 'text', 'entryText', '`title` varchar(128) NOT NULL, ADD FULLTEXT (`title`)', '', NULL, 'string 128', NOW(), 0, 1, 1, 'rw-r--r--'), -(2, 'description', 'Description', 'text3', 'entryText', '`description` varchar(255) NULL DEFAULT NULL, ADD FULLTEXT (`description`)', '', NULL, 'string 255', NOW(), 0, 1, 1, 'rw-r--r--'), -(3, 'content', 'Main content', 'textarea', 'entryText', '`content` text NULL DEFAULT NULL, ADD FULLTEXT (`content`)', '', NULL, 'mysql text', NOW(), 0, 1, 1, 'rw-r--r--'), -(5, 'tag', 'Tag', 'lookupmultiple', 'tag', NULL, '', NULL, 'string 64', NOW(), 0, 1, 1, 'rw-r--r--'), -(6, 'category', 'Category', 'lookupmultiple', 'tag', NULL, '', NULL, 'string 64', NOW(), 0, 1, 1, 'rw-r--r--'), -(7, 'publisher', 'Publisher', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), 0, 1, 1, 'rw-r--r--'), -(8, 'developer', 'Developer', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), 0, 1, 1, 'rw-r--r--'), -(9, 'platform', 'Platform', 'selection', 'entrySingleText', '`platform` varchar(32) NULL DEFAULT NULL', '', 'PC,Xbox,Playstation,Nintendo,Nintendo Switch', 'One of PC,Xbox,Playstation,Nintendo,Nintendo Switch', NOW(), 0, 1, 1, 'rw-r--r--'), -(10, 'storage', 'Storage', 'lookupmultiple', 'tag', NULL, '', NULL, 'string 64', NOW(), 0, 1, 1, 'rw-r--r--'), -(13, 'rating', 'Rating', 'selection', 'entrySingleText', '`rating` varchar(16) NULL DEFAULT NULL', '', '0/10,2/10,3/10,4/10,5/10,6/10,7/10,8/10,9/10,10/10', 'One of 0/10,2/10,3/10,4/10,5/10,6/10,7/10,8/10,9/10,10/10', NOW(), 0, 1, 1, 'rw-r--r--'), -(14, 'year', 'Year', 'number', 'entrySingleNum', '`year` int(10) NULL, ADD INDEX (`year`)', '', NULL, 'int 10', NOW(), 0, 1, 1, 'rw-r--r--'), -(15, 'coverimage', 'Cover image', 'upload', NULL, NULL, '', NULL, 'One file in $_FILES[uploads] of post', NOW(), 0, 1, 1, 'rw-r--r--'), -(16, 'attachment', 'Attachments', 'upload_multiple', NULL, NULL, '', NULL, 'Multiple in $_FILES[uploads] of post', NOW(), 0, 1, 1, 'rw-r--r--'), -(17, 'os', 'Operating system and version', 'selection', 'entrySingleNum', '`os` varchar(32) NULL DEFAULT NULL', '', 'Windows 10,Windows 95, Windows 99,Windows XP, Windows ME, Windows 2000,Windows Vista,Windows 8', 'One of Windows 10,Windows 95, Windows 99,Windows XP, Windows ME, Windows 2000,Windows Vista,Windows 8', NOW(), 0, 1, 1, 'rw-r--r--'), -(18, 'actors', 'Actors', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NULL, 1, 1, 'rw-r--r--'), -(19, 'countries', 'Countries', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NULL, 1, 1, 'rw-r--r--'), -(20, 'directors', 'Directors', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NULL, 1, 1, 'rw-r--r--'), -(21, 'genres', 'Genres', 'lookupmultiple', 'tag', NULL, '', NULL, 'string 64', NOW(), NULL, 1, 1, 'rw-r--r--'), -(22, 'languages', 'Languages', 'lookupmultiple', 'tag', NULL, '', NULL, 'string 64', NOW(), NULL, 1, 1, 'rw-r--r--'), -(23, 'runtime', 'Runtime (min)', 'number', 'entrySingleNum', '`runtime` int(10) NULL, ADD INDEX (`runtime`)', '', NULL, 'int 10', NOW(), NULL, 1, 1, 'rw-r--r--'), -(24, 'imdbrating', 'IMDB Rating', 'text', 'entrySingleText', '`imdbrating` varchar(128) NULL DEFAULT NULL', '', NULL, 'string 128', NOW(), 0, 1, 1, 'rw-r--r--'), -(25, 'viewcount', 'View counter', 'number', 'entrySingleNum', '`viewcount` int(10) NULL, ADD INDEX (`viewcount`)', '', NULL, 'int 10', NOW(), 0, 1, 1, 'rw-r--r--'), -(26, 'writers', 'Writers', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NULL, 1, 1, 'rw-r--r--'), -(27, 'localizedTitle', 'localized Title', 'text', 'entryText', '`localizedTitle` varchar(128) NOT NULL, ADD FULLTEXT (`localizedTitle`)', '', NULL, 'string 128', NOW(), '0', '1', '1', 'rw-r--r--'); +INSERT INTO `bib_sys_fields` (`id`, `identifier`, `displayname`, `type`, `searchtype`, `createstring`, `inputValidation`, `value`, `apiinfo`, `created`, `modified`, `modificationuser`, `owner`, `group`, `rights`) VALUES +(1, 'title', 'Title', 'text', 'entryText', '`title` varchar(128) NOT NULL, ADD FULLTEXT (`title`)', '', NULL, 'string 128', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(2, 'description', 'Description', 'text3', 'entryText', '`description` varchar(255) NULL DEFAULT NULL, ADD FULLTEXT (`description`)', '', NULL, 'string 255', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(3, 'content', 'Main content', 'textarea', 'entryText', '`content` text NULL DEFAULT NULL, ADD FULLTEXT (`content`)', '', NULL, 'mysql text', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(5, 'tag', 'Tag', 'lookupmultiple', 'tag', NULL, '', NULL, 'string 64', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(6, 'category', 'Category', 'lookupmultiple', 'tag', NULL, '', NULL, 'string 64', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(7, 'publisher', 'Publisher', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(8, 'developer', 'Developer', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(9, 'platform', 'Platform', 'selection', 'entrySingleText', '`platform` varchar(32) NULL DEFAULT NULL', '', 'Nintendo,Nintendo Switch,PC,Playstation,Playstation 2,Playstation 3,Playstation 4,Playstation 5,Xbox,Xbox 360,Xbox One,Xbox One S,Xbox One X,Xbox Series S,Xbox Series X', 'One of Nintendo,Nintendo Switch,PC,Playstation,Playstation 2,Playstation 3,Playstation 4,Playstation 5,Xbox,Xbox 360,Xbox One,Xbox One S,Xbox One X,Xbox Series S,Xbox Series X', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(10, 'storage', 'Storage', 'lookupmultiple', 'tag', NULL, '', NULL, 'string 64', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(13, 'rating', 'Rating', 'selection', 'entrySingleText', '`rating` varchar(16) NULL DEFAULT NULL', '', '0/10,2/10,3/10,4/10,5/10,6/10,7/10,8/10,9/10,10/10', 'One of 0/10,2/10,3/10,4/10,5/10,6/10,7/10,8/10,9/10,10/10', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(14, 'year', 'Year', 'year', 'entrySingleNum', '`year` int(10) NULL, ADD INDEX (`year`)', '', NULL, 'int 10', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(15, 'coverimage', 'Cover image', 'upload', NULL, NULL, '', NULL, 'One file in $_FILES[uploads] of post', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(16, 'attachment', 'Attachments', 'upload_multiple', NULL, NULL, '', NULL, 'Multiple in $_FILES[uploads] of post', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(17, 'os', 'Operating system and version', 'selection', 'entrySingleNum', '`os` varchar(32) NULL DEFAULT NULL', '', 'DOS,Windows 1,Windows 2,Windows 3,Windows 95,Windows 99,Windows XP,Windows 2000,Windows ME,Windows Vista,Windows 8,Windows 10', 'One of DOS,Windows 1,Windows 2,Windows 3,Windows 95,Windows 99,Windows XP,Windows 2000,Windows ME,Windows Vista,Windows 8,Windows 10', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(18, 'actors', 'Actors', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NOW(), NULL, 1, 1, 'rw-r--r--'), +(19, 'countries', 'Countries', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NOW(), NULL, 1, 1, 'rw-r--r--'), +(20, 'directors', 'Directors', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NOW(), NULL, 1, 1, 'rw-r--r--'), +(21, 'genres', 'Genres', 'lookupmultiple', 'tag', NULL, '', NULL, 'string 64', NOW(), NOW(), NULL, 1, 1, 'rw-r--r--'), +(22, 'languages', 'Languages', 'lookupmultiple', 'tag', NULL, '', NULL, 'string 64', NOW(), NOW(), NULL, 1, 1, 'rw-r--r--'), +(23, 'runtime', 'Runtime (min)', 'number', 'entrySingleNum', '`runtime` int(10) NULL, ADD INDEX (`runtime`)', '', NULL, 'int 10', NOW(), NOW(), NULL, 1, 1, 'rw-r--r--'), +(24, 'imdbrating', 'IMDB Rating', 'text', 'entrySingleText', '`imdbrating` varchar(128) NULL DEFAULT NULL', '', NULL, 'string 128', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(25, 'viewcount', 'View counter', 'number', 'entrySingleNum', '`viewcount` int(10) NULL, ADD INDEX (`viewcount`)', '', NULL, 'int 10', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(26, 'writers', 'Writers', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NOW(), NULL, 1, 1, 'rw-r--r--'), +(27, 'localizedTitle', 'localized Title', 'text', 'entryText', '`localizedTitle` varchar(128) NULL DEFAULT NULL, ADD FULLTEXT (`localizedTitle`)', '', NULL, 'string 128', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(28, 'gameEngine', 'Game Engine', 'text', 'entryText', '`gameEngine` varchar(128) NOT NULL, ADD FULLTEXT (`gameEngine`)', '', NULL, 'string 128', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(29, 'view', 'View', 'selection', 'entrySingleNum', '`view` varchar(32) NULL DEFAULT NULL', '', 'First person,Third person,Top-down', 'First person,Third person,Top-down', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(30, 'sysReq', 'System Requirements', 'text3', 'entryText', '`sysReq` varchar(255) NULL DEFAULT NULL, ADD FULLTEXT (`sysReq`)', '', NULL, 'string 255', NOW(), NOW(), 0, 1, 1, 'rw-r--r--'), +(31, 'artist', 'Artist', 'text', 'entrySingleText', '`artist` varchar(128) NULL DEFAULT NULL', '', NULL, 'string 128', NOW(), NOW(), NULL, 1, 1, 'rw-r--r--'), +(32, 'artists', 'Artists', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NOW(), NULL, 1, 1, 'rw-r--r--'); -- -------------------------------------------------------- @@ -184,7 +189,8 @@ CREATE TABLE `#REPLACEME#_tool` ( INSERT INTO `#REPLACEME#_tool` (`id`, `name`, `description`, `action`, `target`, `owner`, `group`, `rights`) VALUES (1, 'IMDB web', 'Web parser', 'imdbweb', '_self', 1, 1, 'rw-r--r--'), -(2, 'Game infos', 'Weblinks', 'gameinfo', '_self', 1, 1, 'rw-r--r--'); +(2, 'Game infos', 'Weblinks', 'gameinfo', '_self', 1, 1, 'rw-r--r--'), +(3, 'Musicbrainz', 'Album infos', 'musicbrainz', '_self', 1, 1, 'rw-r--r--'); -- -------------------------------------------------------- @@ -353,13 +359,13 @@ ALTER TABLE `#REPLACEME#_menu` -- AUTO_INCREMENT for table `#REPLACEME#_sys_fields` -- ALTER TABLE `#REPLACEME#_sys_fields` - MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28; + MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; -- -- AUTO_INCREMENT for table `#REPLACEME#_tool` -- ALTER TABLE `#REPLACEME#_tool` - MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; + MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `#REPLACEME#_user` diff --git a/upgrade/from-version-1.2.txt b/upgrade/from-version-1.2.txt new file mode 100644 index 0000000..c35efeb --- /dev/null +++ b/upgrade/from-version-1.2.txt @@ -0,0 +1,3 @@ +# DB changes. Run each line against your bibliotheca DB. +# Replace #REPLACEME# with your table prefix. Default is bib +INSERT INTO `#REPLACEME#_sys_fields` (`id`, `identifier`, `displayname`, `type`, `searchtype`, `createstring`, `inputValidation`, `value`, `apiinfo`, `created`, `modified`, `modificationuser`, `owner`, `group`, `rights`) VALUES (NULL, 'artists', 'Artists', 'lookupmultiple', 'tag', NULL, 'allowSpace', NULL, 'string 64', NOW(), NOW(), NULL, '1', '1', 'rw-r--r--');