View | Details | Raw Unified | Return to bug 7310
Collapse All | Expand All

(-)a/installer/data/mysql/kohastructure.sql (-5 / +25 lines)
Lines 1980-1990 DROP TABLE IF EXISTS `virtualshelves`; Link Here
1980
CREATE TABLE `virtualshelves` ( -- information about lists (or virtual shelves) 
1980
CREATE TABLE `virtualshelves` ( -- information about lists (or virtual shelves) 
1981
  `shelfnumber` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha
1981
  `shelfnumber` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha
1982
  `shelfname` varchar(255) default NULL, -- name of the list
1982
  `shelfname` varchar(255) default NULL, -- name of the list
1983
  `owner` varchar(80) default NULL, -- foriegn key linking to the borrowers table (using borrowernumber) for the creator of this list
1983
  `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)
1984
  `category` varchar(1) default NULL, -- type of list (public [2], private [1] or open [3])
1984
  `category` varchar(1) default NULL, -- type of list (private [1], public [2])
1985
  `sortfield` varchar(16) default NULL, -- the field this list is sorted on
1985
  `sortfield` varchar(16) default NULL, -- the field this list is sorted on
1986
  `lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the list was last modified
1986
  `lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the list was last modified
1987
  PRIMARY KEY  (`shelfnumber`)
1987
  `allow_add` tinyint(1) default 0, -- permission for adding entries to list
1988
  `allow_delete_own` tinyint(1) default 1, -- permission for deleting entries frm list that you added yourself
1989
  `allow_delete_other` tinyint(1) default 0, -- permission for deleting entries from list that another person added
1990
  PRIMARY KEY  (`shelfnumber`),
1991
  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
1988
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1992
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1989
1993
1990
--
1994
--
Lines 1997-2006 CREATE TABLE `virtualshelfcontents` ( -- information about the titles in a list Link Here
1997
  `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
2001
  `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
1998
  `flags` int(11) default NULL,
2002
  `flags` int(11) default NULL,
1999
  `dateadded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- date and time this bib record was added to the list
2003
  `dateadded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- date and time this bib record was added to the list
2004
  `borrowernumber` int, -- borrower number that created this list entry (only the first one is saved: no need for use in/as key)
2000
  KEY `shelfnumber` (`shelfnumber`),
2005
  KEY `shelfnumber` (`shelfnumber`),
2001
  KEY `biblionumber` (`biblionumber`),
2006
  KEY `biblionumber` (`biblionumber`),
2002
  CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2007
  CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2003
  CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
2008
  CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2009
  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
2010
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2011
2012
--
2013
-- Table structure for table `virtualshelfshares`
2014
--
2015
2016
DROP TABLE IF EXISTS `virtualshelfshares`;
2017
CREATE TABLE `virtualshelfshares` ( -- shared private lists
2018
  `id` int AUTO_INCREMENT PRIMARY KEY,  -- unique key
2019
  `shelfnumber` int NOT NULL,  -- foreign key for virtualshelves
2020
  `borrowernumber` int,  -- borrower that accepted access to this list
2021
  `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
2022
  `sharedate` datetime,  -- date of invitation or acceptance of invitation
2023
  CONSTRAINT `virtualshelfshares_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2024
  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
2004
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2025
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2005
2026
2006
--
2027
--
2007
- 

Return to bug 7310