Lines 2002-2012
DROP TABLE IF EXISTS `virtualshelves`;
Link Here
|
2002 |
CREATE TABLE `virtualshelves` ( -- information about lists (or virtual shelves) |
2002 |
CREATE TABLE `virtualshelves` ( -- information about lists (or virtual shelves) |
2003 |
`shelfnumber` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha |
2003 |
`shelfnumber` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha |
2004 |
`shelfname` varchar(255) default NULL, -- name of the list |
2004 |
`shelfname` varchar(255) default NULL, -- name of the list |
2005 |
`owner` varchar(80) default NULL, -- foriegn key linking to the borrowers table (using borrowernumber) for the creator of this list |
2005 |
`owner` int default NULL, -- foreign key linking to the borrowers table (using borrowernumber) for the creator of this list (changed from varchar(80) to int) |
2006 |
`category` varchar(1) default NULL, -- type of list (public [2], private [1] or open [3]) |
2006 |
`category` varchar(1) default NULL, -- type of list (private [1], public [2]) |
2007 |
`sortfield` varchar(16) default NULL, -- the field this list is sorted on |
2007 |
`sortfield` varchar(16) default NULL, -- the field this list is sorted on |
2008 |
`lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the list was last modified |
2008 |
`lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the list was last modified |
2009 |
PRIMARY KEY (`shelfnumber`) |
2009 |
`allow_add` tinyint(1) default 0, -- permission for adding entries to list |
|
|
2010 |
`allow_delete_own` tinyint(1) default 1, -- permission for deleting entries frm list that you added yourself |
2011 |
`allow_delete_other` tinyint(1) default 0, -- permission for deleting entries from list that another person added |
2012 |
PRIMARY KEY (`shelfnumber`), |
2013 |
CONSTRAINT `virtualshelves_ibfk_1` FOREIGN KEY (`owner`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL -- no cascaded delete, please see HandleDelBorrower in VirtualShelves.pm |
2010 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
2014 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
2011 |
|
2015 |
|
2012 |
-- |
2016 |
-- |
Lines 2019-2028
CREATE TABLE `virtualshelfcontents` ( -- information about the titles in a list
Link Here
|
2019 |
`biblionumber` int(11) NOT NULL default 0, -- foreign key linking to the biblio table, defines the bib record that has been added to the list |
2023 |
`biblionumber` int(11) NOT NULL default 0, -- foreign key linking to the biblio table, defines the bib record that has been added to the list |
2020 |
`flags` int(11) default NULL, |
2024 |
`flags` int(11) default NULL, |
2021 |
`dateadded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- date and time this bib record was added to the list |
2025 |
`dateadded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- date and time this bib record was added to the list |
|
|
2026 |
`borrowernumber` int, -- borrower number that created this list entry (only the first one is saved: no need for use in/as key) |
2022 |
KEY `shelfnumber` (`shelfnumber`), |
2027 |
KEY `shelfnumber` (`shelfnumber`), |
2023 |
KEY `biblionumber` (`biblionumber`), |
2028 |
KEY `biblionumber` (`biblionumber`), |
2024 |
CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
2029 |
CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
2025 |
CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE |
2030 |
CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
|
|
2031 |
CONSTRAINT `shelfcontents_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL -- no cascaded delete, please see HandleDelBorrower in VirtualShelves.pm |
2032 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
2033 |
|
2034 |
-- |
2035 |
-- Table structure for table `virtualshelfshares` |
2036 |
-- |
2037 |
|
2038 |
DROP TABLE IF EXISTS `virtualshelfshares`; |
2039 |
CREATE TABLE `virtualshelfshares` ( -- shared private lists |
2040 |
`id` int AUTO_INCREMENT PRIMARY KEY, -- unique key |
2041 |
`shelfnumber` int NOT NULL, -- foreign key for virtualshelves |
2042 |
`borrowernumber` int, -- borrower that accepted access to this list |
2043 |
`invitekey` varchar(10), -- temporary string used in accepting the invitation to access thist list; not-empty means that the invitation has not been accepted yet |
2044 |
`sharedate` datetime, -- date of invitation or acceptance of invitation |
2045 |
CONSTRAINT `virtualshelfshares_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
2046 |
CONSTRAINT `virtualshelfshares_ibfk_2` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL -- no cascaded delete, please see HandleDelBorrower in VirtualShelves.pm |
2026 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
2047 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
2027 |
|
2048 |
|
2028 |
-- |
2049 |
-- |
2029 |
- |
|
|