Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##Hi there!
- ##I want to get rid of borrowers.flags, because computing that binary-array column is very hard and unnecessary.
- ##We dont really need that flag-system at all, since all we need are singular permissions for singular tasks.
- diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
- index 70effc7..b7a2862 100644
- --- a/installer/data/mysql/kohastructure.sql
- +++ b/installer/data/mysql/kohastructure.sql
- @@ -280,7 +280,6 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons
- `ethnotes` varchar(255) default NULL, -- unused in Koha
- `sex` varchar(1) default NULL, -- patron/borrower's gender
- `password` varchar(60) default NULL, -- patron/borrower's encrypted password
- - `flags` int(11) default NULL, -- will include a number associated with the staff member's permissions
- `userid` varchar(75) default NULL, -- patron/borrower's opac and/or staff client log in
- `opacnote` mediumtext, -- a note on the patron/borrower's account that is visible in the OPAC and staff client
- `contactnote` varchar(255) default NULL, -- a note related to the patron/borrower's alternate address
- @@ -2323,19 +2322,6 @@ CREATE TABLE `tags_index` ( -- a weighted list of all tags and where they are us
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
- --
- --- Table structure for table `userflags`
- ---
- -
- -DROP TABLE IF EXISTS `userflags`;
- -CREATE TABLE `userflags` (
- - `bit` int(11) NOT NULL default 0,
- - `flag` varchar(30) default NULL,
- - `flagdesc` varchar(255) default NULL,
- - `defaulton` int(11) default NULL,
- - PRIMARY KEY (`bit`)
- -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
- -
- ---
- -- Table structure for table `virtualshelves`
- --
- @@ -3393,6 +3350,55 @@ CREATE TABLE IF NOT EXISTS `borrower_modifications` (
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
- --
- +-- Table structure for table permissions
- +--
- +
- +DROP TABLE IF EXISTS permissions;
- +CREATE TABLE permissions (
- + permission_id int(11) NOT NULL auto_increment,
- + module varchar(32) NOT NULL,
- + code varchar(64) NOT NULL,
- + description varchar(255) DEFAULT NULL,
- + PRIMARY KEY (permission_id),
- + UNIQUE KEY (code),
- + CONSTRAINT permissions_to_modules_ibfk1 FOREIGN KEY (module) REFERENCES permission_modules (module)
- + ON DELETE CASCADE ON UPDATE CASCADE
- +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
- +
- +--
- +-- Table structure for table permission_modules
- +--
- +
- +DROP TABLE IF EXISTS permission_modules;
- +CREATE TABLE permission_modules (
- + permission_module_id int(11) NOT NULL auto_increment,
- + module varchar(32) NOT NULL,
- + description varchar(255) DEFAULT NULL,
- + PRIMARY KEY (permission_module_id),
- + UNIQUE KEY (module)
- +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
- +
- +--
- +-- Table structure for table borrower_permissions
- +--
- +
- +DROP TABLE IF EXISTS borrower_permissions;
- +CREATE TABLE borrower_permissions (
- + borrower_permission_id int(11) NOT NULL auto_increment,
- + borrowernumber int(11) NOT NULL,
- + permission_module_id int(11) NOT NULL,
- + permission_id int(11) NOT NULL,
- + PRIMARY KEY (borrower_permission_id),
- + UNIQUE KEY (borrowernumber, permission_module_id, permission_id),
- + CONSTRAINT borrower_permissions_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber)
- + ON DELETE CASCADE ON UPDATE CASCADE,
- + CONSTRAINT borrower_permissions_ibfk_2 FOREIGN KEY (permission_id) REFERENCES permissions (permission_id)
- + ON DELETE CASCADE ON UPDATE CASCADE,
- + CONSTRAINT borrower_permissions_ibfk_3 FOREIGN KEY (permission_module_id) REFERENCES permission_modules (permissi
- + ON DELETE CASCADE ON UPDATE CASCADE
- +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
- +
- +--
- -- Table structure for table linktracker
- -- This stores clicks to external links
- --
- (END)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement