kohabug 2076 - remove three tables (DB rev 077)
[koha.git] / installer / data / mysql / kohastructure.sql
index 964614d..8dd16fd 100644 (file)
@@ -596,18 +596,6 @@ CREATE TABLE `categories` (
   UNIQUE KEY `categorycode` (`categorycode`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
---
--- Table structure for table `categorytable`
---
-
-DROP TABLE IF EXISTS `categorytable`;
-CREATE TABLE `categorytable` (
-  `categorycode` varchar(5) NOT NULL default '',
-  `description` text,
-  `itemtypecodes` text,
-  PRIMARY KEY  (`categorycode`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
 --
 -- Table structure for table `cities`
 --
@@ -872,7 +860,9 @@ CREATE TABLE `import_batches` (
   `num_biblios` int(11) NOT NULL default 0,
   `num_items` int(11) NOT NULL default 0,
   `upload_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
-  `overlay_action` enum('replace', 'create_new', 'use_template') NOT NULL default 'create_new',
+  `overlay_action` enum('replace', 'create_new', 'use_template', 'ignore') NOT NULL default 'create_new',
+  `nomatch_action` enum('create_new', 'ignore') NOT NULL default 'create_new',
+  `item_action` enum('always_add', 'add_only_for_matches', 'add_only_for_new', 'ignore') NOT NULL default 'always_add',
   `import_status` enum('staging', 'staged', 'importing', 'imported', 'reverting', 'reverted', 'cleaned') NOT NULL default 'staging',
   `batch_type` enum('batch', 'z3950') NOT NULL default 'batch',
   `file_name` varchar(100),
@@ -898,7 +888,7 @@ CREATE TABLE `import_records` (
   `marcxml_old` longtext NOT NULL,
   `record_type` enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio',
   `overlay_status` enum('no_match', 'auto_match', 'manual_match', 'match_applied') NOT NULL default 'no_match',
-  `status` enum('error', 'staged', 'imported', 'reverted', 'items_reverted') NOT NULL default 'staged',
+  `status` enum('error', 'staged', 'imported', 'reverted', 'items_reverted', 'ignored') NOT NULL default 'staged',
   `import_error` mediumtext,
   `encoding` varchar(40) NOT NULL default '',
   `z3950random` varchar(40) default NULL,
@@ -954,7 +944,7 @@ CREATE TABLE `import_items` (
   `import_record_id` int(11) NOT NULL,
   `itemnumber` int(11) default NULL,
   `branchcode` varchar(10) default NULL,
-  `status` enum('error', 'staged', 'imported', 'reverted') NOT NULL default 'staged',
+  `status` enum('error', 'staged', 'imported', 'reverted', 'ignored') NOT NULL default 'staged',
   `marcxml` longtext NOT NULL,
   `import_error` mediumtext,
   PRIMARY KEY (`import_items_id`),
@@ -1318,18 +1308,6 @@ CREATE TABLE `matchchecks` (
   REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
---
--- Table structure for table `mediatypetable`
---
-
-DROP TABLE IF EXISTS `mediatypetable`;
-CREATE TABLE `mediatypetable` (
-  `mediatypecode` varchar(5) NOT NULL default '',
-  `description` text,
-  `itemtypecodes` text,
-  PRIMARY KEY  (`mediatypecode`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
 --
 -- Table structure for table `notifys`
 --
@@ -1724,18 +1702,6 @@ DROP TABLE IF EXISTS `stopwords`;
   `word` varchar(255) default NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
---
--- Table structure for table `subcategorytable`
---
-
-DROP TABLE IF EXISTS `subcategorytable`;
-CREATE TABLE `subcategorytable` (
-  `subcategorycode` varchar(5) NOT NULL default '',
-  `description` text,
-  `itemtypecodes` text,
-  PRIMARY KEY  (`subcategorycode`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
 --
 -- Table structure for table `subscription`
 --
@@ -1874,6 +1840,58 @@ CREATE TABLE `tags` (
   PRIMARY KEY  (`entry`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
+--
+-- Table structure for table `tags_all`
+--
+
+CREATE TABLE `tags_all` (
+  `tag_id`         int(11) NOT NULL auto_increment,
+  `borrowernumber` int(11) NOT NULL,
+  `biblionumber`   int(11) NOT NULL,
+  `term`      varchar(255) NOT NULL,
+  `language`       int(4) default NULL,
+  `date_created` datetime  NOT NULL,
+  PRIMARY KEY  (`tag_id`),
+  KEY `tags_borrowers_fk_1` (`borrowernumber`),
+  KEY `tags_biblionumber_fk_1` (`biblionumber`),
+  CONSTRAINT `tags_borrowers_fk_1` FOREIGN KEY (`borrowernumber`)
+        REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `tags_biblionumber_fk_1` FOREIGN KEY (`biblionumber`)
+        REFERENCES `biblio`     (`biblionumber`)  ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `tags_approval`
+--
+
+CREATE TABLE `tags_approval` (
+  `term`   varchar(255) NOT NULL,
+  `approved`     int(1) NOT NULL default '0',
+  `date_approved` datetime       default NULL,
+  `approved_by` int(11)          default NULL,
+  `weight_total` int(9) NOT NULL default '1',
+  PRIMARY KEY  (`term`),
+  KEY `tags_approval_borrowers_fk_1` (`approved_by`),
+  CONSTRAINT `tags_approval_borrowers_fk_1` FOREIGN KEY (`approved_by`)
+        REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `tags_index`
+--
+
+CREATE TABLE `tags_index` (
+  `term`    varchar(255) NOT NULL,
+  `biblionumber` int(11) NOT NULL,
+  `weight`        int(9) NOT NULL default '1',
+  PRIMARY KEY  (`term`,`biblionumber`),
+  KEY `tags_index_biblionumber_fk_1` (`biblionumber`),
+  CONSTRAINT `tags_index_term_fk_1` FOREIGN KEY (`term`)
+        REFERENCES `tags_approval` (`term`)  ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `tags_index_biblionumber_fk_1` FOREIGN KEY (`biblionumber`)
+        REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
 --
 -- Table structure for table `userflags`
 --