Bug 8977:replace unitialized directory var in printoverdues
[koha_fer] / installer / data / mysql / kohastructure.sql
index a514d99..c0d9936 100644 (file)
@@ -177,8 +177,8 @@ CREATE TABLE `biblioitems` ( -- information related to bibliographic records in
   `cn_class` varchar(30) default NULL,
   `cn_item` varchar(10) default NULL,
   `cn_suffix` varchar(10) default NULL,
-  `cn_sort` varchar(30) default NULL,
-  `agerestriction` varchar(255) default NULL,
+  `cn_sort` varchar(30) default NULL, -- normalized version of the call number used for sorting
+  `agerestriction` varchar(255) default NULL, -- target audience/age restriction from the bib record (MARC21 521$a)
   `totalissues` int(10),
   `marcxml` longtext NOT NULL, -- full bibliographic MARC record in MARCXML
   PRIMARY KEY  (`biblioitemnumber`),
@@ -256,8 +256,8 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons
   `altcontactsurname` varchar(255) default NULL, -- surname or last name of the alternate contact for the patron/borrower
   `altcontactaddress1` varchar(255) default NULL, -- the first address line for the alternate contact for the patron/borrower
   `altcontactaddress2` varchar(255) default NULL, -- the second address line for the alternate contact for the patron/borrower
-  `altcontactaddress3` varchar(255) default NULL, -- the third address line for the alternate contact for the patron/borrower
-  `altcontactstate` text default NULL, -- the city and state for the alternate contact for the patron/borrower
+  `altcontactaddress3` varchar(255) default NULL, -- the city for the alternate contact for the patron/borrower
+  `altcontactstate` text default NULL, -- the state for the alternate contact for the patron/borrower
   `altcontactzipcode` varchar(50) default NULL, -- the zipcode for the alternate contact for the patron/borrower
   `altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
   `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
@@ -650,8 +650,8 @@ CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records t
   `cn_class` varchar(30) default NULL,
   `cn_item` varchar(10) default NULL,
   `cn_suffix` varchar(10) default NULL,
-  `cn_sort` varchar(30) default NULL,
-  `agerestriction` varchar(255) default NULL,
+  `cn_sort` varchar(30) default NULL, -- normalized version of the call number used for sorting
+  `agerestriction` varchar(255) default NULL, -- target audience/age restriction from the bib record (MARC21 521$a)
   `totalissues` int(10),
   `marcxml` longtext NOT NULL, -- full bibliographic MARC record in MARCXML
   PRIMARY KEY  (`biblioitemnumber`),
@@ -727,8 +727,8 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower
   `altcontactsurname` varchar(255) default NULL, -- surname or last name of the alternate contact for the patron/borrower
   `altcontactaddress1` varchar(255) default NULL, -- the first address line for the alternate contact for the patron/borrower
   `altcontactaddress2` varchar(255) default NULL, -- the second address line for the alternate contact for the patron/borrower
-  `altcontactaddress3` varchar(255) default NULL, -- the third address line for the alternate contact for the patron/borrower
-  `altcontactstate` text default NULL, -- the city and state for the alternate contact for the patron/borrower
+  `altcontactaddress3` varchar(255) default NULL, -- the city for the alternate contact for the patron/borrower
+  `altcontactstate` text default NULL, -- the state for the alternate contact for the patron/borrower
   `altcontactzipcode` varchar(50) default NULL, -- the zipcode for the alternate contact for the patron/borrower
   `altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
   `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
@@ -762,6 +762,7 @@ CREATE TABLE `deleteditems` (
   `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
   `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
   `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
+  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
   `issues` smallint(6) default NULL, -- number of times this item has been checked out
   `renewals` smallint(6) default NULL, -- number of times this item has been renewed
   `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
@@ -855,7 +856,7 @@ CREATE TABLE `import_batches` ( -- information about batches of marc records tha
   `matcher_id` int(11) default NULL, -- the id of the match rule used (matchpoints.matcher_id)
   `template_id` int(11) default NULL,
   `branchcode` varchar(10) default NULL,
-  `num_biblios` int(11) NOT NULL default 0, -- number of bib records in the file
+  `num_records` int(11) NOT NULL default 0, -- number of records in the file
   `num_items` int(11) NOT NULL default 0, -- number of items in the file
   `upload_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- date and time the file was uploaded
   `overlay_action` enum('replace', 'create_new', 'use_template', 'ignore') NOT NULL default 'create_new', -- how to handle duplicate records
@@ -863,6 +864,7 @@ CREATE TABLE `import_batches` ( -- information about batches of marc records tha
   `item_action` enum('always_add', 'add_only_for_matches', 'add_only_for_new', 'ignore') NOT NULL default 'always_add', -- what to do with item records
   `import_status` enum('staging', 'staged', 'importing', 'imported', 'reverting', 'reverted', 'cleaned') NOT NULL default 'staging', -- the status of the imported file
   `batch_type` enum('batch', 'z3950', 'webservice') NOT NULL default 'batch', -- where this batch has come from
+  `record_type` enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio', -- type of record in the batch
   `file_name` varchar(100), -- the name of the file uploaded
   `comments` mediumtext, -- any comments added when the file was uploaded
   PRIMARY KEY (`import_batch_id`),
@@ -911,6 +913,22 @@ CREATE TABLE `import_record_matches` ( -- matches found when importing a batch o
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 --
+-- Table structure for table `import_auths`
+--
+
+DROP TABLE IF EXISTS `import_auths`;
+CREATE TABLE `import_auths` (
+  `import_record_id` int(11) NOT NULL,
+  `matched_authid` int(11) default NULL,
+  `control_number` varchar(25) default NULL,
+  `authorized_heading` varchar(128) default NULL,
+  `original_source` varchar(25) default NULL,
+  CONSTRAINT `import_auths_ibfk_1` FOREIGN KEY (`import_record_id`)
+             REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+  KEY `matched_authid` (`matched_authid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
 -- Table structure for table `import_biblios`
 --
 
@@ -1030,6 +1048,7 @@ CREATE TABLE `items` ( -- holdings/item information
   `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
   `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
   `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
+  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
   `issues` smallint(6) default NULL, -- number of times this item has been checked out/issued
   `renewals` smallint(6) default NULL, -- number of times this item has been renewed
   `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
@@ -1831,6 +1850,7 @@ CREATE TABLE `statistics` ( -- information related to transactions (circulation
   `itemtype` varchar(10) default NULL, -- foreign key from the itemtypes table, links transaction to a specific item type
   `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table, links transaction to a specific borrower
   `associatedborrower` int(11) default NULL,
+  `ccode` int(11) default NULL, -- foreign key from the items table, links transaction to a specific collection code
   KEY `timeidx` (`datetime`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
@@ -2577,6 +2597,8 @@ CREATE TABLE `aqbasket` ( -- stores data about baskets in acquisitions
   `authorisedby` varchar(10) default NULL, -- the borrowernumber of the person who created the basket
   `booksellerinvoicenumber` mediumtext, -- appears to always be NULL
   `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
   PRIMARY KEY  (`basketno`),
   KEY `booksellerid` (`booksellerid`),
   KEY `basketgroupid` (`basketgroupid`),
@@ -2769,7 +2791,8 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items
   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this order line was last modified
   `rrp` decimal(13,2) default NULL, -- the replacement cost for this line item
   `ecost` decimal(13,2) default NULL, -- the estimated cost for this line item
-  `gst` decimal(13,2) default NULL, -- the tax rate for this line item
+  `gstrate` decimal(6,4) default NULL, -- the tax rate for this line item
+  `discount` float(6,4) default NULL, -- the discount for this line item
   `budget_id` int(11) NOT NULL, -- the fund this order goes against (aqbudgets.budget_id)
   `budgetgroup_id` int(11) NOT NULL, -- not used? always zero
   `budgetdate` date default NULL, -- not used? always NULL