`linkid` tinyint(1) NOT NULL default 0,
`kohafield` varchar(45) NULL default '',
`frameworkcode` varchar(10) NOT NULL default '',
- `defaultvalue` TEXT DEFAULT '',
+ `defaultvalue` TEXT,
PRIMARY KEY (`authtypecode`,`tagfield`,`tagsubfield`),
KEY `tab` (`authtypecode`,`tab`),
CONSTRAINT `auth_subfield_structure_ibfk_1` FOREIGN KEY (`authtypecode`) REFERENCES `auth_types` (`authtypecode`) ON DELETE CASCADE ON UPDATE CASCADE
CONSTRAINT `auth_tag_structure_ibfk_1` FOREIGN KEY (`authtypecode`) REFERENCES `auth_types` (`authtypecode`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+--
+-- Table structure for table `authorised_value_categories`
+--
+
+DROP TABLE IF EXISTS `authorised_value_categories`;
+CREATE TABLE `authorised_value_categories` (
+ `category_name` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
+ PRIMARY KEY (`category_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
--
-- Table structure for table `authorised_values`
--
`category_type` varchar(1) NOT NULL default 'A', -- type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)
`BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions
`default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category
+ `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'.
PRIMARY KEY (`categorycode`),
UNIQUE KEY `categorycode` (`categorycode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
`sms_provider_id` int(11) DEFAULT NULL, -- the provider of the mobile phone number defined in smsalertnumber
`privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history KEY `borrowernumber` (`borrowernumber`),
`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)
KEY borrowernumber (borrowernumber),
KEY `cardnumber` (`cardnumber`),
KEY `sms_provider_id` (`sms_provider_id`)
`norenewalbefore` int(4) default NULL, -- no renewal allowed until X days or hours before due date.
`auto_renew` BOOLEAN default FALSE, -- automatic renewal
`reservesallowed` smallint(6) NOT NULL default "0", -- how many holds are allowed
+ `holds_per_record` SMALLINT(6) NOT NULL DEFAULT 1, -- How many holds a patron can have on a given bib
`branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode)
overduefinescap decimal(28,6) default NULL, -- the maximum amount of an overdue fine
cap_fine_to_replacement_price BOOLEAN NOT NULL DEFAULT '0', -- cap the fine based on item's replacement price
KEY `itemtype` (`itemtype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+--
+-- Table structure for table `refund_lost_item_fee_rules`
+--
+
+DROP TABLE IF EXISTS `refund_lost_item_fee_rules`;
+CREATE TABLE `refund_lost_item_fee_rules` ( -- refund lost item fee rules tbale
+ `branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode)
+ `refund` tinyint(1) NOT NULL default 0, -- control wether to refund lost item fees on return
+ PRIMARY KEY (`branchcode`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
--
-- Table structure for table `items`
--
`mandatory` tinyint(4) NOT NULL default 0,
`kohafield` varchar(40) default NULL,
`tab` tinyint(1) default NULL,
- `authorised_value` varchar(20) default NULL,
+ `authorised_value` varchar(32) default NULL,
`authtypecode` varchar(20) default NULL,
`value_builder` varchar(80) default NULL,
`isurl` tinyint(1) default NULL,
PRIMARY KEY (`frameworkcode`,`tagfield`,`tagsubfield`),
KEY `kohafield_2` (`kohafield`),
KEY `tab` (`frameworkcode`,`tab`),
- KEY `kohafield` (`frameworkcode`,`kohafield`)
+ KEY `kohafield` (`frameworkcode`,`kohafield`),
+ CONSTRAINT `marc_subfield_structure_ibfk_1` FOREIGN KEY (`authorised_value`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
`sms_provider_id` int(11) DEFAULT NULL, -- the provider of the mobile phone number defined in smsalertnumber
`privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
`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)
UNIQUE KEY `cardnumber` (`cardnumber`),
PRIMARY KEY `borrowernumber` (`borrowernumber`),
KEY `categorycode` (`categorycode`),
`borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron left this comment
`biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bibliographic record this comment is for
`review` text, -- the body of the comment
- `approved` tinyint(4) default NULL, -- whether this comment has been approved by a librarian (1 for yes, 0 for no)
+ `approved` tinyint(4) default 0, -- whether this comment has been approved by a librarian (1 for yes, 0 for no)
`datereviewed` datetime default NULL, -- the date the comment was left
PRIMARY KEY (`reviewid`),
CONSTRAINT `reviews_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
`enddate` date default NULL, -- subscription end date
`closed` INT(1) NOT NULL DEFAULT 0, -- yes / no if the subscription is closed
`reneweddate` date default NULL, -- date of last renewal for the subscription
+ `itemtype` VARCHAR( 10 ) NULL,
+ `previousitemtype` VARCHAR( 10 ) NULL,
PRIMARY KEY (`subscriptionid`),
CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
`category` varchar(1) default NULL, -- type of list (private [1], public [2])
`sortfield` varchar(16) default 'title', -- the field this list is sorted on
`lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the list was last modified
- `created_on` TIMESTAMP NOT NULL, -- creation time
+ `created_on` datetime NOT NULL, -- creation time
`allow_add` tinyint(1) default 0, -- permission for adding entries to list
`allow_delete_own` tinyint(1) default 1, -- permission for deleting entries frm list that you added yourself
`allow_delete_other` tinyint(1) default 0, -- permission for deleting entries from list that another person added
`action` text, -- the action (includes things like DELETED, ADDED, MODIFY, etc)
`object` int(11) default NULL, -- the object that the action was taken against (could be a borrowernumber, itemnumber, etc)
`info` text, -- information about the action (usually includes SQL statement)
+ `interface` VARCHAR(30) DEFAULT NULL, -- the context this action was taken in
PRIMARY KEY (`action_id`),
KEY `timestamp_idx` (`timestamp`),
KEY `user_idx` (`user`),
KEY `module_idx` (`module`(255)),
KEY `action_idx` (`action`(255)),
KEY `object_idx` (`object`),
- KEY `info_idx` (`info`(255))
+ KEY `info_idx` (`info`(255)),
+ KEY `interface` (`interface`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
authorised_values_category VARCHAR(32) NULL DEFAULT NULL,
PRIMARY KEY(name),
CONSTRAINT items_search_fields_authorised_values_category
- FOREIGN KEY (authorised_values_category) REFERENCES authorised_values (category)
+ FOREIGN KEY (authorised_values_category) REFERENCES authorised_value_categories (category_name)
ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;