From: Banana Date: Sun, 17 Jan 2021 15:24:47 +0000 (+0100) Subject: current sql for setup X-Git-Tag: 1.1~26 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=09c9b83721641a22b4101e3e8dc53dcdec618fca;p=bibliotheca-php.git current sql for setup --- diff --git a/documentation/setup/bibliotheca.sql b/documentation/setup/bibliotheca.sql index 6bd188b..19f88b3 100644 --- a/documentation/setup/bibliotheca.sql +++ b/documentation/setup/bibliotheca.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 --- Generation Time: Dec 30, 2020 at 10:41 AM +-- Generation Time: Jan 17, 2021 at 03:22 PM -- Server version: 8.0.22 -- PHP Version: 7.4.13 @@ -18,14 +18,18 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; +-- +-- Database: `bibliotheca` +-- + -- -------------------------------------------------------- -- --- Table structure for table `bib_collection` +-- Table structure for table `#REPLACEME#_collection` -- DROP TABLE IF EXISTS `#REPLACEME#_collection`; -CREATE TABLE `bib_collection` ( +CREATE TABLE `#REPLACEME#_collection` ( `id` int NOT NULL, `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, @@ -41,7 +45,7 @@ CREATE TABLE `bib_collection` ( -- -------------------------------------------------------- -- --- Table structure for table `bib_group` +-- Table structure for table `#REPLACEME#_group` -- DROP TABLE IF EXISTS `#REPLACEME#_group`; @@ -99,11 +103,12 @@ INSERT INTO `#REPLACEME#_menu` (`id`, `text`, `action`, `icon`, `owner`, `group` (7, 'Collections', 'managecolletions', 'database', 1, 2, 'rw-rw----', 3, 'manage'), (8, 'Users', 'manageusers', 'users', 1, 1, 'rw-------', 4, 'manage'), (9, 'Login', 'auth', '', 1, 1, 'rw-r--r--', 0, ''), -(10, 'Collection fields', 'managecollectionfields', '', 1, 1, 'rw-------', 0, ''), +(10, 'Collection fields', 'managecollectionfields', '', 1, 2, 'rw-rw----', 0, ''), (11, 'Entry', 'entry', '', 1, 1, 'rw-r--r--', 0, ''), (12, 'Search', 'search', '', 1, 1, 'rw-r--r--', 0, ''), -(13, 'Edit', 'collections', 'pencil', 1, 2, 'rw-rw----', 1, 'manage'), -(14, 'Tool', 'tool', '', 1, 1, 'rw-------', 0, ''); +(14, 'Tool', 'tool', '', 1, 1, 'rw-------', 0, ''), +(15, 'Profile', 'profile', 'user', 1, 2, 'rw-rw----', 5, 'manage'), +(16, 'Groups', 'managegroups', 'users', 1, 1, 'rw-------', 6, 'manage'); -- -------------------------------------------------------- @@ -170,7 +175,7 @@ CREATE TABLE `#REPLACEME#_tool` ( `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `action` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `target` varchar(16) NOT NULL, + `target` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL, `owner` int NOT NULL, `group` int NOT NULL, `rights` char(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL @@ -263,10 +268,6 @@ CREATE TABLE `#REPLACEME#_userSession` ( `salt` char(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Dumping data for table `#REPLACEME#_userSession` --- - -- -- Indexes for dumped tables -- @@ -347,13 +348,13 @@ ALTER TABLE `#REPLACEME#_group` -- AUTO_INCREMENT for table `#REPLACEME#_menu` -- ALTER TABLE `#REPLACEME#_menu` - MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; + MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; -- -- AUTO_INCREMENT for table `#REPLACEME#_sys_fields` -- ALTER TABLE `#REPLACEME#_sys_fields` - MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; + MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27; -- -- AUTO_INCREMENT for table `#REPLACEME#_tool` diff --git a/upgrade/from-version-1.0.txt b/upgrade/from-version-1.0.txt index bdde49f..968a158 100644 --- a/upgrade/from-version-1.0.txt +++ b/upgrade/from-version-1.0.txt @@ -6,9 +6,10 @@ have on the old config files. After that you can delete config/database|path|sys The definition of USER_DEFAULT_RIGHTS_STRING can be removed from config file. # DB changes. Run each line against your bibliotheca DB. -UPDATE `bib_menu` SET `rights` = 'rw-rw----' WHERE `bib_menu`.`id` = 10; -UPDATE `bib_menu` SET `group` = '2' WHERE `bib_menu`.`id` = 10; -INSERT INTO `bib_menu` (`id`, `text`, `action`, `icon`, `owner`, `group`, `rights`, `position`, `category`) VALUES (NULL, 'Profile', 'profile', 'user', '1', '2', 'rw-rw----', '5', 'manage'); -DELETE FROM `bib_menu` WHERE `bib_menu`.`id` = 13; -INSERT INTO `bib_menu` (`id`, `text`, `action`, `icon`, `owner`, `group`, `rights`, `position`, `category`) VALUES (NULL, 'Groups', 'managegroups', 'users', '1', '1', 'rw-------', '5', 'manage'); -UPDATE `bib_menu` SET `position` = '6' WHERE `bib_menu`.`id` = 16; +# Replace #REPLACEME# with your table prefix. Default is bib +UPDATE `#REPLACEME#_menu` SET `rights` = 'rw-rw----' WHERE `bib_menu`.`id` = 10; +UPDATE `#REPLACEME#_menu` SET `group` = '2' WHERE `bib_menu`.`id` = 10; +INSERT INTO `#REPLACEME#_menu` (`id`, `text`, `action`, `icon`, `owner`, `group`, `rights`, `position`, `category`) VALUES (NULL, 'Profile', 'profile', 'user', '1', '2', 'rw-rw----', '5', 'manage'); +DELETE FROM `#REPLACEME#_menu` WHERE `bib_menu`.`id` = 13; +INSERT INTO `#REPLACEME#_menu` (`id`, `text`, `action`, `icon`, `owner`, `group`, `rights`, `position`, `category`) VALUES (NULL, 'Groups', 'managegroups', 'users', '1', '1', 'rw-------', '5', 'manage'); +UPDATE `#REPLACEME#_menu` SET `position` = '6' WHERE `bib_menu`.`id` = 16;