Bug 7249 : Allow reports to be called through a restful interface
[koha.git] / installer / data / mysql / kohastructure.sql
index 71eaeb0..9a94e0f 100644 (file)
@@ -286,7 +286,7 @@ CREATE TABLE `borrower_attribute_types` ( -- definitions for custom patron field
   `staff_searchable` tinyint(1) NOT NULL default 0, -- defines if this field is searchable via the patron search in the staff client (1 for yes, 0 for no)
   `authorised_value_category` varchar(10) default NULL, -- foreign key from authorised_values that links this custom field to an authorized value category
   `display_checkout` tinyint(1) NOT NULL default 0,-- defines if this field displays in checkout screens
-  `category_code` VARCHAR(1) NOT NULL DEFAULT '',-- defines a category for an attribute_type
+  `category_code` VARCHAR(1) NULL DEFAULT NULL,-- defines a category for an attribute_type
   `class` VARCHAR(255) NOT NULL DEFAULT '',-- defines a class for an attribute_type
   PRIMARY KEY  (`code`),
   KEY `auth_val_cat_idx` (`authorised_value_category`)
@@ -1545,6 +1545,7 @@ CREATE TABLE `patronimage` (
 -- this table is MyISAM, InnoDB tables are growing only and this table is filled/emptied/filled/emptied...
 -- so MyISAM is better in this case
 
+DROP TABLE IF EXISTS `pending_offline_operations`;
 CREATE TABLE `pending_offline_operations` (
   `operationid` int(11) NOT NULL AUTO_INCREMENT,
   `userid` varchar(30) NOT NULL,
@@ -1713,6 +1714,8 @@ CREATE TABLE saved_sql (
    `report_name` varchar(255) default NULL,
    `type` varchar(255) default NULL,
    `notes` text,
+   `cache_expiry` int NOT NULL default 300,
+   `public` boolean NOT NULL default FALSE,
    PRIMARY KEY  (`id`),
    KEY boridx (`borrowernumber`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -2819,9 +2822,9 @@ CREATE TABLE IF NOT EXISTS `social_data` (
 
 DROP TABLE IF EXISTS ratings;
 CREATE TABLE ratings (
-    borrowernumber int(11) NOT NULL, --- the borrower this rating is for
-    biblionumber int(11) NOT NULL, --- the biblio it's for
-    rating_value tinyint(1) NOT NULL, --- the rating, from 1-5
+    borrowernumber int(11) NOT NULL, -- the borrower this rating is for
+    biblionumber int(11) NOT NULL, -- the biblio it's for
+    rating_value tinyint(1) NOT NULL, -- the rating, from 1-5
     timestamp timestamp NOT NULL default CURRENT_TIMESTAMP,
     PRIMARY KEY  (borrowernumber,biblionumber),
     CONSTRAINT ratings_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,