Bug 15685: Allow creation of items (AcqCreateItem) to be customizable per-basket
[koha.git] / installer / data / mysql / kohastructure.sql
index 4944bf4..14c82e7 100644 (file)
@@ -168,7 +168,7 @@ CREATE TABLE `biblioitems` ( -- information related to bibliographic records in
   `itemtype` varchar(10) default NULL, -- biblio level item type (MARC21 942$c)
   `isbn` mediumtext, -- ISBN (MARC21 020$a)
   `issn` mediumtext, -- ISSN (MARC21 022$a)
-  `ean` varchar(13) default NULL,
+  `ean` mediumtext default NULL,
   `publicationyear` text,
   `publishercode` varchar(255) default NULL, -- publisher (MARC21 260$b)
   `volumedate` date default NULL,
@@ -199,6 +199,7 @@ CREATE TABLE `biblioitems` ( -- information related to bibliographic records in
   KEY `itemtype_idx` (`itemtype`),
   KEY `isbn` (`isbn`(255)),
   KEY `issn` (`issn`(255)),
+  KEY `ean` (`ean`(255)),
   KEY `publishercode` (`publishercode`),
   KEY `timestamp` (`timestamp`),
   CONSTRAINT `biblioitems_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -280,6 +281,7 @@ CREATE TABLE `branches` ( -- information about your libraries or branches are st
   `branchnotes` mediumtext, -- notes related to your library or branch
   opac_info text, -- HTML that displays in OPAC
   `geolocation` VARCHAR(255) default NULL, -- geolocation of your library
+  `marcorgcode` VARCHAR(16) default NULL, -- MARC Organization Code, see http://www.loc.gov/marc/organizations/orgshome.html, when empty defaults to syspref MARCOrgCode
   PRIMARY KEY (`branchcode`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
@@ -524,7 +526,7 @@ CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records t
   `itemtype` varchar(10) default NULL, -- biblio level item type (MARC21 942$c)
   `isbn` mediumtext default NULL, -- ISBN (MARC21 020$a)
   `issn` mediumtext default NULL, -- ISSN (MARC21 022$a)
-  `ean` varchar(13) default NULL,
+  `ean` mediumtext default NULL,
   `publicationyear` text,
   `publishercode` varchar(255) default NULL, -- publisher (MARC21 260$b)
   `volumedate` date default NULL,
@@ -554,6 +556,7 @@ CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records t
   KEY `bibnoidx` (`biblionumber`),
   KEY `itemtype_idx` (`itemtype`),
   KEY `isbn` (`isbn`(255)),
+  KEY `ean` (`ean`(255)),
   KEY `publishercode` (`publishercode`),
   KEY `timestamp` (`timestamp`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
@@ -600,6 +603,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower
   `categorycode` varchar(10) NOT NULL default '', -- foreign key from the categories table, includes the code of the patron category
   `dateenrolled` date default NULL, -- date the patron was added to Koha (YYYY-MM-DD)
   `dateexpiry` date default NULL, -- date the patron/borrower's card is set to expire (YYYY-MM-DD)
+  `date_renewed` date default NULL, -- date the patron/borrower's card was last renewed
   `gonenoaddress` tinyint(1) default NULL, -- set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having an unconfirmed address
   `lost` tinyint(1) default NULL, -- set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having lost their card
   `debarred` date default NULL, -- until this date the patron can only check-in (no loans, no holds, etc.), is a fine based on days instead of money (YYYY-MM-DD)
@@ -633,7 +637,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower
   `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
   `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'.
   `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others)
-  `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface)
+  `lastseen` datetime default NULL, -- last time a patron has been seen (connected at the OPAC or staff interface)
   `lang` varchar(25) NOT NULL default 'default', -- lang to use to send notices to this patron
   `login_attempts` int(4) default 0, -- number of failed login attemps
   `overdrive_auth_token` text default NULL, -- persist OverDrive auth token
@@ -1637,6 +1641,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons
   `categorycode` varchar(10) NOT NULL default '', -- foreign key from the categories table, includes the code of the patron category
   `dateenrolled` date default NULL, -- date the patron was added to Koha (YYYY-MM-DD)
   `dateexpiry` date default NULL, -- date the patron/borrower's card is set to expire (YYYY-MM-DD)
+  `date_renewed` date default NULL, -- date the patron/borrower's card was last renewed
   `gonenoaddress` tinyint(1) default NULL, -- set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having an unconfirmed address
   `lost` tinyint(1) default NULL, -- set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having lost their card
   `debarred` date default NULL, -- until this date the patron can only check-in (no loans, no holds, etc.), is a fine based on days instead of money (YYYY-MM-DD)
@@ -2987,6 +2992,7 @@ CREATE TABLE `aqbasket` ( -- stores data about baskets in acquisitions
   `basketgroupid` int(11), -- links this basket to its group (aqbasketgroups.id)
   `deliveryplace` varchar(10) default NULL, -- basket delivery place
   `billingplace` varchar(10) default NULL, -- basket billing place
+  create_items ENUM('ordering', 'receiving', 'cataloguing') default NULL; -- when items should be created for orders in this basket
   branch varchar(10) default NULL, -- basket branch
   is_standing TINYINT(1) NOT NULL DEFAULT 0, -- orders in this basket are standing
   PRIMARY KEY  (`basketno`),
@@ -3418,6 +3424,7 @@ CREATE TABLE IF NOT EXISTS `borrower_modifications` (
   `categorycode` varchar(10) DEFAULT NULL,
   `dateenrolled` date DEFAULT NULL,
   `dateexpiry` date DEFAULT NULL,
+  `date_renewed` date default NULL,
   `gonenoaddress` tinyint(1) DEFAULT NULL,
   `lost` tinyint(1) DEFAULT NULL,
   `debarred` date DEFAULT NULL,