View | Details | Raw Unified | Return to bug 11944
Collapse All | Expand All

(-)a/installer/data/mysql/kohastructure.sql (-159 / +159 lines)
Lines 32-38 CREATE TABLE `auth_header` ( Link Here
32
  `marcxml` longtext NOT NULL,
32
  `marcxml` longtext NOT NULL,
33
  PRIMARY KEY  (`authid`),
33
  PRIMARY KEY  (`authid`),
34
  KEY `origincode` (`origincode`)
34
  KEY `origincode` (`origincode`)
35
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
35
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
36
36
37
--
37
--
38
-- Table structure for table `auth_subfield_structure`
38
-- Table structure for table `auth_subfield_structure`
Lines 59-65 CREATE TABLE `auth_subfield_structure` ( Link Here
59
  `defaultvalue` TEXT DEFAULT '',
59
  `defaultvalue` TEXT DEFAULT '',
60
  PRIMARY KEY  (`authtypecode`,`tagfield`,`tagsubfield`),
60
  PRIMARY KEY  (`authtypecode`,`tagfield`,`tagsubfield`),
61
  KEY `tab` (`authtypecode`,`tab`)
61
  KEY `tab` (`authtypecode`,`tab`)
62
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
62
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
63
63
64
--
64
--
65
-- Table structure for table `auth_tag_structure`
65
-- Table structure for table `auth_tag_structure`
Lines 76-82 CREATE TABLE `auth_tag_structure` ( Link Here
76
  `authorised_value` varchar(10) default NULL,
76
  `authorised_value` varchar(10) default NULL,
77
  PRIMARY KEY  (`authtypecode`,`tagfield`),
77
  PRIMARY KEY  (`authtypecode`,`tagfield`),
78
  CONSTRAINT `auth_tag_structure_ibfk_1` FOREIGN KEY (`authtypecode`) REFERENCES `auth_types` (`authtypecode`) ON DELETE CASCADE ON UPDATE CASCADE
78
  CONSTRAINT `auth_tag_structure_ibfk_1` FOREIGN KEY (`authtypecode`) REFERENCES `auth_types` (`authtypecode`) ON DELETE CASCADE ON UPDATE CASCADE
79
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
79
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
80
80
81
--
81
--
82
-- Table structure for table `auth_types`
82
-- Table structure for table `auth_types`
Lines 89-95 CREATE TABLE `auth_types` ( Link Here
89
  `auth_tag_to_report` varchar(3) NOT NULL default '',
89
  `auth_tag_to_report` varchar(3) NOT NULL default '',
90
  `summary` mediumtext NOT NULL,
90
  `summary` mediumtext NOT NULL,
91
  PRIMARY KEY  (`authtypecode`)
91
  PRIMARY KEY  (`authtypecode`)
92
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
92
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
93
93
94
--
94
--
95
-- Table structure for table `authorised_values`
95
-- Table structure for table `authorised_values`
Lines 107-113 CREATE TABLE `authorised_values` ( -- stores values for authorized values catego Link Here
107
  KEY `name` (`category`),
107
  KEY `name` (`category`),
108
  KEY `lib` (`lib`),
108
  KEY `lib` (`lib`),
109
  KEY `auth_value_idx` (`authorised_value`)
109
  KEY `auth_value_idx` (`authorised_value`)
110
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
110
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
111
111
112
--
112
--
113
-- Table structure for table `biblio`
113
-- Table structure for table `biblio`
Lines 129-135 CREATE TABLE `biblio` ( -- table that stores bibliographic information Link Here
129
  `abstract` mediumtext, -- summary from the MARC record (520$a in MARC21)
129
  `abstract` mediumtext, -- summary from the MARC record (520$a in MARC21)
130
  PRIMARY KEY  (`biblionumber`),
130
  PRIMARY KEY  (`biblionumber`),
131
  KEY `blbnoidx` (`biblionumber`)
131
  KEY `blbnoidx` (`biblionumber`)
132
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
132
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
133
133
134
--
134
--
135
-- Table structure for table `biblio_framework`
135
-- Table structure for table `biblio_framework`
Lines 140-146 CREATE TABLE `biblio_framework` ( -- information about MARC frameworks Link Here
140
  `frameworkcode` varchar(4) NOT NULL default '', -- the unique code assigned to the framework
140
  `frameworkcode` varchar(4) NOT NULL default '', -- the unique code assigned to the framework
141
  `frameworktext` varchar(255) NOT NULL default '', -- the description/name given to the framework
141
  `frameworktext` varchar(255) NOT NULL default '', -- the description/name given to the framework
142
  PRIMARY KEY  (`frameworkcode`)
142
  PRIMARY KEY  (`frameworkcode`)
143
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
143
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
144
144
145
--
145
--
146
-- Table structure for table `biblioitems`
146
-- Table structure for table `biblioitems`
Lines 190-196 CREATE TABLE `biblioitems` ( -- information related to bibliographic records in Link Here
190
  KEY `issn` (`issn`(255)),
190
  KEY `issn` (`issn`(255)),
191
  KEY `publishercode` (`publishercode`),
191
  KEY `publishercode` (`publishercode`),
192
  CONSTRAINT `biblioitems_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
192
  CONSTRAINT `biblioitems_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
193
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
193
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
194
194
195
--
195
--
196
-- Table structure for table `borrowers`
196
-- Table structure for table `borrowers`
Lines 276-282 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
276
  KEY `othernames_idx` (`othernames`(255)),
276
  KEY `othernames_idx` (`othernames`(255)),
277
  CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`),
277
  CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`),
278
  CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
278
  CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
279
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
279
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
280
280
281
--
281
--
282
-- Table structure for table `borrower_attribute_types`
282
-- Table structure for table `borrower_attribute_types`
Lines 297-303 CREATE TABLE `borrower_attribute_types` ( -- definitions for custom patron field Link Here
297
  `class` VARCHAR(255) NOT NULL DEFAULT '',-- defines a class for an attribute_type
297
  `class` VARCHAR(255) NOT NULL DEFAULT '',-- defines a class for an attribute_type
298
  PRIMARY KEY  (`code`),
298
  PRIMARY KEY  (`code`),
299
  KEY `auth_val_cat_idx` (`authorised_value_category`)
299
  KEY `auth_val_cat_idx` (`authorised_value_category`)
300
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
300
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
301
301
302
--
302
--
303
-- Table structure for table `borrower_attributes`
303
-- Table structure for table `borrower_attributes`
Lines 315-321 CREATE TABLE `borrower_attributes` ( -- values of custom patron fields known as Link Here
315
    ON DELETE CASCADE ON UPDATE CASCADE,
315
    ON DELETE CASCADE ON UPDATE CASCADE,
316
  CONSTRAINT `borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`)
316
  CONSTRAINT `borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`)
317
    ON DELETE CASCADE ON UPDATE CASCADE
317
    ON DELETE CASCADE ON UPDATE CASCADE
318
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
318
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
319
319
320
--
320
--
321
-- Table structure for table `borrower_debarments`
321
-- Table structure for table `borrower_debarments`
Lines 335-341 CREATE TABLE borrower_debarments ( Link Here
335
  KEY borrowernumber (borrowernumber),
335
  KEY borrowernumber (borrowernumber),
336
  CONSTRAINT `borrower_debarments_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
336
  CONSTRAINT `borrower_debarments_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
337
    ON DELETE CASCADE ON UPDATE CASCADE
337
    ON DELETE CASCADE ON UPDATE CASCADE
338
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
338
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
339
339
340
340
341
--
341
--
Lines 354-360 CREATE TABLE `branch_item_rules` ( -- information entered in the circulation and Link Here
354
    ON DELETE CASCADE ON UPDATE CASCADE,
354
    ON DELETE CASCADE ON UPDATE CASCADE,
355
  CONSTRAINT `branch_item_rules_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
355
  CONSTRAINT `branch_item_rules_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
356
    ON DELETE CASCADE ON UPDATE CASCADE
356
    ON DELETE CASCADE ON UPDATE CASCADE
357
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
357
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
358
358
359
--
359
--
360
-- Table structure for table `branchcategories`
360
-- Table structure for table `branchcategories`
Lines 369-375 CREATE TABLE `branchcategories` ( -- information related to library/branch group Link Here
369
  `show_in_pulldown` tinyint(1) NOT NULL DEFAULT '0', -- says this group should be in the opac libararies pulldown if it is enabled
369
  `show_in_pulldown` tinyint(1) NOT NULL DEFAULT '0', -- says this group should be in the opac libararies pulldown if it is enabled
370
  PRIMARY KEY  (`categorycode`),
370
  PRIMARY KEY  (`categorycode`),
371
  KEY `show_in_pulldown` (`show_in_pulldown`)
371
  KEY `show_in_pulldown` (`show_in_pulldown`)
372
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
372
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
373
373
374
--
374
--
375
-- Table structure for table `branches`
375
-- Table structure for table `branches`
Lines 396-402 CREATE TABLE `branches` ( -- information about your libraries or branches are st Link Here
396
  `branchnotes` mediumtext, -- notes related to your library or branch
396
  `branchnotes` mediumtext, -- notes related to your library or branch
397
  opac_info text, -- HTML that displays in OPAC
397
  opac_info text, -- HTML that displays in OPAC
398
  PRIMARY KEY (`branchcode`)
398
  PRIMARY KEY (`branchcode`)
399
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
399
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
400
400
401
--
401
--
402
-- Table structure for table `branchrelations`
402
-- Table structure for table `branchrelations`
Lines 411-417 CREATE TABLE `branchrelations` ( -- this table links libraries/branches to group Link Here
411
  KEY `categorycode` (`categorycode`),
411
  KEY `categorycode` (`categorycode`),
412
  CONSTRAINT `branchrelations_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
412
  CONSTRAINT `branchrelations_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
413
  CONSTRAINT `branchrelations_ibfk_2` FOREIGN KEY (`categorycode`) REFERENCES `branchcategories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE
413
  CONSTRAINT `branchrelations_ibfk_2` FOREIGN KEY (`categorycode`) REFERENCES `branchcategories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE
414
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
414
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
415
415
416
--
416
--
417
-- Table structure for table `branchtransfers`
417
-- Table structure for table `branchtransfers`
Lines 431-437 CREATE TABLE `branchtransfers` ( -- information for items that are in transit be Link Here
431
  CONSTRAINT `branchtransfers_ibfk_1` FOREIGN KEY (`frombranch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
431
  CONSTRAINT `branchtransfers_ibfk_1` FOREIGN KEY (`frombranch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
432
  CONSTRAINT `branchtransfers_ibfk_2` FOREIGN KEY (`tobranch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
432
  CONSTRAINT `branchtransfers_ibfk_2` FOREIGN KEY (`tobranch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
433
  CONSTRAINT `branchtransfers_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
433
  CONSTRAINT `branchtransfers_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
434
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
434
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
435
435
436
436
437
--
437
--
Lines 444-450 CREATE TABLE `browser` ( Link Here
444
  `description` varchar(255) NOT NULL,
444
  `description` varchar(255) NOT NULL,
445
  `number` bigint(20) NOT NULL,
445
  `number` bigint(20) NOT NULL,
446
  `endnode` tinyint(4) NOT NULL
446
  `endnode` tinyint(4) NOT NULL
447
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
447
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
448
448
449
--
449
--
450
-- Table structure for table `categories`
450
-- Table structure for table `categories`
Lines 470-476 CREATE TABLE `categories` ( -- this table shows information related to Koha patr Link Here
470
  `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category
470
  `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category
471
  PRIMARY KEY  (`categorycode`),
471
  PRIMARY KEY  (`categorycode`),
472
  UNIQUE KEY `categorycode` (`categorycode`)
472
  UNIQUE KEY `categorycode` (`categorycode`)
473
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
473
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
474
474
475
--
475
--
476
-- Table: collections
476
-- Table: collections
Lines 516-522 CREATE TABLE `courses` ( Link Here
516
  `enabled` enum('yes','no') NOT NULL DEFAULT 'yes', -- Determines whether the course is active
516
  `enabled` enum('yes','no') NOT NULL DEFAULT 'yes', -- Determines whether the course is active
517
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
517
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
518
   PRIMARY KEY (`course_id`)
518
   PRIMARY KEY (`course_id`)
519
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
519
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
520
520
521
--
521
--
522
-- Table structure for table `course_instructors`
522
-- Table structure for table `course_instructors`
Lines 532-538 CREATE TABLE `course_instructors` ( Link Here
532
  `borrowernumber` int(11) NOT NULL,
532
  `borrowernumber` int(11) NOT NULL,
533
  PRIMARY KEY (`course_id`,`borrowernumber`),
533
  PRIMARY KEY (`course_id`,`borrowernumber`),
534
  KEY `borrowernumber` (`borrowernumber`)
534
  KEY `borrowernumber` (`borrowernumber`)
535
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
535
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
536
536
537
--
537
--
538
-- Constraints for table `course_instructors`
538
-- Constraints for table `course_instructors`
Lines 562-568 CREATE TABLE `course_items` ( Link Here
562
   PRIMARY KEY (`ci_id`),
562
   PRIMARY KEY (`ci_id`),
563
   UNIQUE KEY `itemnumber` (`itemnumber`),
563
   UNIQUE KEY `itemnumber` (`itemnumber`),
564
   KEY `holdingbranch` (`holdingbranch`)
564
   KEY `holdingbranch` (`holdingbranch`)
565
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
565
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
566
566
567
--
567
--
568
-- Constraints for table `course_items`
568
-- Constraints for table `course_items`
Lines 589-595 CREATE TABLE `course_reserves` ( Link Here
589
   PRIMARY KEY (`cr_id`),
589
   PRIMARY KEY (`cr_id`),
590
   UNIQUE KEY `pseudo_key` (`course_id`,`ci_id`),
590
   UNIQUE KEY `pseudo_key` (`course_id`,`ci_id`),
591
   KEY `course_id` (`course_id`)
591
   KEY `course_id` (`course_id`)
592
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
592
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
593
593
594
--
594
--
595
-- Constraints for table `course_reserves`
595
-- Constraints for table `course_reserves`
Lines 611-617 CREATE TABLE `branch_borrower_circ_rules` ( -- includes default circulation rule Link Here
611
    ON DELETE CASCADE ON UPDATE CASCADE,
611
    ON DELETE CASCADE ON UPDATE CASCADE,
612
  CONSTRAINT `branch_borrower_circ_rules_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
612
  CONSTRAINT `branch_borrower_circ_rules_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
613
    ON DELETE CASCADE ON UPDATE CASCADE
613
    ON DELETE CASCADE ON UPDATE CASCADE
614
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
614
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
615
615
616
--
616
--
617
-- Table structure for table `default_borrower_circ_rules`
617
-- Table structure for table `default_borrower_circ_rules`
Lines 624-630 CREATE TABLE `default_borrower_circ_rules` ( -- default checkout rules found und Link Here
624
  PRIMARY KEY (`categorycode`),
624
  PRIMARY KEY (`categorycode`),
625
  CONSTRAINT `borrower_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
625
  CONSTRAINT `borrower_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
626
    ON DELETE CASCADE ON UPDATE CASCADE
626
    ON DELETE CASCADE ON UPDATE CASCADE
627
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
627
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
628
628
629
--
629
--
630
-- Table structure for table `default_branch_circ_rules`
630
-- Table structure for table `default_branch_circ_rules`
Lines 639-645 CREATE TABLE `default_branch_circ_rules` ( Link Here
639
  PRIMARY KEY (`branchcode`),
639
  PRIMARY KEY (`branchcode`),
640
  CONSTRAINT `default_branch_circ_rules_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
640
  CONSTRAINT `default_branch_circ_rules_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
641
    ON DELETE CASCADE ON UPDATE CASCADE
641
    ON DELETE CASCADE ON UPDATE CASCADE
642
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
642
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
643
643
644
--
644
--
645
-- Table structure for table `default_branch_item_rules`
645
-- Table structure for table `default_branch_item_rules`
Lines 652-658 CREATE TABLE `default_branch_item_rules` ( Link Here
652
  PRIMARY KEY  (`itemtype`),
652
  PRIMARY KEY  (`itemtype`),
653
  CONSTRAINT `default_branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
653
  CONSTRAINT `default_branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
654
    ON DELETE CASCADE ON UPDATE CASCADE
654
    ON DELETE CASCADE ON UPDATE CASCADE
655
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
655
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
656
656
657
--
657
--
658
-- Table structure for table `default_circ_rules`
658
-- Table structure for table `default_circ_rules`
Lines 665-671 CREATE TABLE `default_circ_rules` ( Link Here
665
    `holdallowed` int(1) default NULL,
665
    `holdallowed` int(1) default NULL,
666
    `returnbranch` varchar(15) default NULL,
666
    `returnbranch` varchar(15) default NULL,
667
    PRIMARY KEY (`singleton`)
667
    PRIMARY KEY (`singleton`)
668
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
668
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
669
669
670
--
670
--
671
-- Table structure for table `cities`
671
-- Table structure for table `cities`
Lines 679-685 CREATE TABLE `cities` ( -- authorized values for cities/states/countries to choo Link Here
679
  `city_country` VARCHAR( 100 ) NULL DEFAULT NULL, -- name of the country
679
  `city_country` VARCHAR( 100 ) NULL DEFAULT NULL, -- name of the country
680
  `city_zipcode` varchar(20) default NULL, -- zip or postal code
680
  `city_zipcode` varchar(20) default NULL, -- zip or postal code
681
  PRIMARY KEY  (`cityid`)
681
  PRIMARY KEY  (`cityid`)
682
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
682
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
683
683
684
--
684
--
685
-- Table structure for table `class_sort_rules`
685
-- Table structure for table `class_sort_rules`
Lines 692-698 CREATE TABLE `class_sort_rules` ( Link Here
692
  `sort_routine` varchar(30) NOT NULL default '',
692
  `sort_routine` varchar(30) NOT NULL default '',
693
  PRIMARY KEY (`class_sort_rule`),
693
  PRIMARY KEY (`class_sort_rule`),
694
  UNIQUE KEY `class_sort_rule_idx` (`class_sort_rule`)
694
  UNIQUE KEY `class_sort_rule_idx` (`class_sort_rule`)
695
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
695
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
696
696
697
--
697
--
698
-- Table structure for table `class_sources`
698
-- Table structure for table `class_sources`
Lines 708-714 CREATE TABLE `class_sources` ( Link Here
708
  UNIQUE KEY `cn_source_idx` (`cn_source`),
708
  UNIQUE KEY `cn_source_idx` (`cn_source`),
709
  KEY `used_idx` (`used`),
709
  KEY `used_idx` (`used`),
710
  CONSTRAINT `class_source_ibfk_1` FOREIGN KEY (`class_sort_rule`) REFERENCES `class_sort_rules` (`class_sort_rule`)
710
  CONSTRAINT `class_source_ibfk_1` FOREIGN KEY (`class_sort_rule`) REFERENCES `class_sort_rules` (`class_sort_rule`)
711
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
711
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
712
712
713
--
713
--
714
-- Table structure for table `currency`
714
-- Table structure for table `currency`
Lines 723-729 CREATE TABLE `currency` ( Link Here
723
  `rate` float(15,5) default NULL,
723
  `rate` float(15,5) default NULL,
724
  `active` tinyint(1) default NULL,
724
  `active` tinyint(1) default NULL,
725
  PRIMARY KEY  (`currency`)
725
  PRIMARY KEY  (`currency`)
726
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
726
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
727
727
728
--
728
--
729
-- Table structure for table `deletedbiblio`
729
-- Table structure for table `deletedbiblio`
Lines 745-751 CREATE TABLE `deletedbiblio` ( -- stores information about bibliographic records Link Here
745
  `abstract` mediumtext, -- summary from the MARC record (520$a in MARC21)
745
  `abstract` mediumtext, -- summary from the MARC record (520$a in MARC21)
746
  PRIMARY KEY  (`biblionumber`),
746
  PRIMARY KEY  (`biblionumber`),
747
  KEY `blbnoidx` (`biblionumber`)
747
  KEY `blbnoidx` (`biblionumber`)
748
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
748
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
749
749
750
--
750
--
751
-- Table structure for table `deletedbiblioitems`
751
-- Table structure for table `deletedbiblioitems`
Lines 793-799 CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records t Link Here
793
  KEY `itemtype_idx` (`itemtype`),
793
  KEY `itemtype_idx` (`itemtype`),
794
  KEY `isbn` (`isbn`(255)),
794
  KEY `isbn` (`isbn`(255)),
795
  KEY `publishercode` (`publishercode`)
795
  KEY `publishercode` (`publishercode`)
796
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
796
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
797
797
798
--
798
--
799
-- Table structure for table `deletedborrowers`
799
-- Table structure for table `deletedborrowers`
Lines 870-876 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
870
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
870
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
871
  KEY borrowernumber (borrowernumber),
871
  KEY borrowernumber (borrowernumber),
872
  KEY `cardnumber` (`cardnumber`)
872
  KEY `cardnumber` (`cardnumber`)
873
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
873
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
874
874
875
--
875
--
876
-- Table structure for table `deleteditems`
876
-- Table structure for table `deleteditems`
Lines 928-934 CREATE TABLE `deleteditems` ( Link Here
928
  KEY `delhomebranch` (`homebranch`),
928
  KEY `delhomebranch` (`homebranch`),
929
  KEY `delholdingbranch` (`holdingbranch`),
929
  KEY `delholdingbranch` (`holdingbranch`),
930
  KEY `itype_idx` (`itype`)
930
  KEY `itype_idx` (`itype`)
931
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
931
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
932
932
933
--
933
--
934
-- Table structure for table `ethnicity`
934
-- Table structure for table `ethnicity`
Lines 939-945 CREATE TABLE `ethnicity` ( Link Here
939
  `code` varchar(10) NOT NULL default '',
939
  `code` varchar(10) NOT NULL default '',
940
  `name` varchar(255) default NULL,
940
  `name` varchar(255) default NULL,
941
  PRIMARY KEY  (`code`)
941
  PRIMARY KEY  (`code`)
942
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
942
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
943
943
944
--
944
--
945
-- Table structure for table `export_format`
945
-- Table structure for table `export_format`
Lines 981-987 CREATE TABLE hold_fill_targets ( Link Here
981
    REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
981
    REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
982
  CONSTRAINT `hold_fill_targets_ibfk_4` FOREIGN KEY (`source_branchcode`)
982
  CONSTRAINT `hold_fill_targets_ibfk_4` FOREIGN KEY (`source_branchcode`)
983
    REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
983
    REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
984
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
984
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
985
985
986
--
986
--
987
-- Table structure for table `import_batches`
987
-- Table structure for table `import_batches`
Lines 1006-1012 CREATE TABLE `import_batches` ( -- information about batches of marc records tha Link Here
1006
  `comments` mediumtext, -- any comments added when the file was uploaded
1006
  `comments` mediumtext, -- any comments added when the file was uploaded
1007
  PRIMARY KEY (`import_batch_id`),
1007
  PRIMARY KEY (`import_batch_id`),
1008
  KEY `branchcode` (`branchcode`)
1008
  KEY `branchcode` (`branchcode`)
1009
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1009
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1010
1010
1011
--
1011
--
1012
-- Table structure for table `import_records`
1012
-- Table structure for table `import_records`
Lines 1035-1041 CREATE TABLE `import_records` ( Link Here
1035
  KEY `branchcode` (`branchcode`),
1035
  KEY `branchcode` (`branchcode`),
1036
  KEY `batch_sequence` (`import_batch_id`, `record_sequence`),
1036
  KEY `batch_sequence` (`import_batch_id`, `record_sequence`),
1037
  KEY `batch_id_record_type` (`import_batch_id`,`record_type`)
1037
  KEY `batch_id_record_type` (`import_batch_id`,`record_type`)
1038
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1038
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1039
1039
1040
--
1040
--
1041
-- Table structure for `import_record_matches`
1041
-- Table structure for `import_record_matches`
Lines 1048-1054 CREATE TABLE `import_record_matches` ( -- matches found when importing a batch o Link Here
1048
  CONSTRAINT `import_record_matches_ibfk_1` FOREIGN KEY (`import_record_id`)
1048
  CONSTRAINT `import_record_matches_ibfk_1` FOREIGN KEY (`import_record_id`)
1049
             REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
1049
             REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
1050
  KEY `record_score` (`import_record_id`, `score`)
1050
  KEY `record_score` (`import_record_id`, `score`)
1051
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1051
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1052
1052
1053
--
1053
--
1054
-- Table structure for table `import_auths`
1054
-- Table structure for table `import_auths`
Lines 1064-1070 CREATE TABLE `import_auths` ( Link Here
1064
  CONSTRAINT `import_auths_ibfk_1` FOREIGN KEY (`import_record_id`)
1064
  CONSTRAINT `import_auths_ibfk_1` FOREIGN KEY (`import_record_id`)
1065
             REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
1065
             REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
1066
  KEY `matched_authid` (`matched_authid`)
1066
  KEY `matched_authid` (`matched_authid`)
1067
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1067
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1068
1068
1069
--
1069
--
1070
-- Table structure for table `import_biblios`
1070
-- Table structure for table `import_biblios`
Lines 1086-1092 CREATE TABLE `import_biblios` ( Link Here
1086
  KEY `matched_biblionumber` (`matched_biblionumber`),
1086
  KEY `matched_biblionumber` (`matched_biblionumber`),
1087
  KEY `title` (`title`),
1087
  KEY `title` (`title`),
1088
  KEY `isbn` (`isbn`)
1088
  KEY `isbn` (`isbn`)
1089
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1089
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1090
1090
1091
--
1091
--
1092
-- Table structure for table `import_items`
1092
-- Table structure for table `import_items`
Lines 1106-1112 CREATE TABLE `import_items` ( Link Here
1106
             REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
1106
             REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
1107
  KEY `itemnumber` (`itemnumber`),
1107
  KEY `itemnumber` (`itemnumber`),
1108
  KEY `branchcode` (`branchcode`)
1108
  KEY `branchcode` (`branchcode`)
1109
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1109
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1110
1110
1111
--
1111
--
1112
-- Table structure for table `issues`
1112
-- Table structure for table `issues`
Lines 1132-1138 CREATE TABLE `issues` ( -- information related to check outs or issues Link Here
1132
  KEY `bordate` (`borrowernumber`,`timestamp`),
1132
  KEY `bordate` (`borrowernumber`,`timestamp`),
1133
  CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE RESTRICT ON UPDATE CASCADE,
1133
  CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE RESTRICT ON UPDATE CASCADE,
1134
  CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE RESTRICT ON UPDATE CASCADE
1134
  CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE RESTRICT ON UPDATE CASCADE
1135
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1135
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1136
1136
1137
--
1137
--
1138
-- Table structure for table `issuingrules`
1138
-- Table structure for table `issuingrules`
Lines 1166-1172 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
1166
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
1166
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
1167
  KEY `categorycode` (`categorycode`),
1167
  KEY `categorycode` (`categorycode`),
1168
  KEY `itemtype` (`itemtype`)
1168
  KEY `itemtype` (`itemtype`)
1169
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1169
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1170
1170
1171
--
1171
--
1172
-- Table structure for table `items`
1172
-- Table structure for table `items`
Lines 1230-1236 CREATE TABLE `items` ( -- holdings/item information Link Here
1230
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1230
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1231
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
1231
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
1232
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
1232
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
1233
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1233
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1234
1234
1235
--
1235
--
1236
-- Table structure for table `itemtypes`
1236
-- Table structure for table `itemtypes`
Lines 1249-1255 CREATE TABLE `itemtypes` ( -- defines the item types Link Here
1249
  sip_media_type VARCHAR(3) DEFAULT NULL, -- SIP2 protocol media type for this itemtype
1249
  sip_media_type VARCHAR(3) DEFAULT NULL, -- SIP2 protocol media type for this itemtype
1250
  PRIMARY KEY  (`itemtype`),
1250
  PRIMARY KEY  (`itemtype`),
1251
  UNIQUE KEY `itemtype` (`itemtype`)
1251
  UNIQUE KEY `itemtype` (`itemtype`)
1252
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1252
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1253
1253
1254
--
1254
--
1255
-- Table structure for table `creator_batches`
1255
-- Table structure for table `creator_batches`
Lines 1273-1279 CREATE TABLE `creator_batches` ( Link Here
1273
  CONSTRAINT `creator_batches_ibfk_1` FOREIGN KEY (`borrower_number`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1273
  CONSTRAINT `creator_batches_ibfk_1` FOREIGN KEY (`borrower_number`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1274
  CONSTRAINT `creator_batches_ibfk_2` FOREIGN KEY (`branch_code`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE,
1274
  CONSTRAINT `creator_batches_ibfk_2` FOREIGN KEY (`branch_code`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE,
1275
  CONSTRAINT `creator_batches_ibfk_3` FOREIGN KEY (`item_number`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE
1275
  CONSTRAINT `creator_batches_ibfk_3` FOREIGN KEY (`item_number`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE
1276
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1276
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1277
1277
1278
--
1278
--
1279
-- Table structure for table `creator_images`
1279
-- Table structure for table `creator_images`
Lines 1288-1294 CREATE TABLE `creator_images` ( Link Here
1288
  `image_name` char(20) NOT NULL DEFAULT 'DEFAULT',
1288
  `image_name` char(20) NOT NULL DEFAULT 'DEFAULT',
1289
  PRIMARY KEY (`image_id`),
1289
  PRIMARY KEY (`image_id`),
1290
  UNIQUE KEY `image_name_index` (`image_name`)
1290
  UNIQUE KEY `image_name_index` (`image_name`)
1291
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1291
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1292
1292
1293
--
1293
--
1294
-- Table structure for table `creator_layouts`
1294
-- Table structure for table `creator_layouts`
Lines 1313-1319 CREATE TABLE `creator_layouts` ( Link Here
1313
  `layout_xml` text NOT NULL,
1313
  `layout_xml` text NOT NULL,
1314
  `creator` char(15) NOT NULL DEFAULT 'Labels',
1314
  `creator` char(15) NOT NULL DEFAULT 'Labels',
1315
  PRIMARY KEY (`layout_id`)
1315
  PRIMARY KEY (`layout_id`)
1316
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1316
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1317
1317
1318
--
1318
--
1319
-- Table structure for table `creator_templates`
1319
-- Table structure for table `creator_templates`
Lines 1343-1349 CREATE TABLE `creator_templates` ( Link Here
1343
  `creator` char(15) NOT NULL DEFAULT 'Labels',
1343
  `creator` char(15) NOT NULL DEFAULT 'Labels',
1344
  PRIMARY KEY (`template_id`),
1344
  PRIMARY KEY (`template_id`),
1345
  KEY `template_profile_fk_constraint` (`profile_id`)
1345
  KEY `template_profile_fk_constraint` (`profile_id`)
1346
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1346
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1347
1347
1348
--
1348
--
1349
-- Table structure for table `letter`
1349
-- Table structure for table `letter`
Lines 1362-1368 CREATE TABLE `letter` ( -- table for all notice templates in Koha Link Here
1362
  PRIMARY KEY  (`module`,`code`, `branchcode`, `message_transport_type`),
1362
  PRIMARY KEY  (`module`,`code`, `branchcode`, `message_transport_type`),
1363
  CONSTRAINT `message_transport_type_fk` FOREIGN KEY (`message_transport_type`)
1363
  CONSTRAINT `message_transport_type_fk` FOREIGN KEY (`message_transport_type`)
1364
  REFERENCES `message_transport_types` (`message_transport_type`) ON DELETE CASCADE ON UPDATE CASCADE
1364
  REFERENCES `message_transport_types` (`message_transport_type`) ON DELETE CASCADE ON UPDATE CASCADE
1365
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1365
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1366
1366
1367
--
1367
--
1368
-- Table structure for table `marc_subfield_structure`
1368
-- Table structure for table `marc_subfield_structure`
Lines 1392-1398 CREATE TABLE `marc_subfield_structure` ( Link Here
1392
  KEY `kohafield_2` (`kohafield`),
1392
  KEY `kohafield_2` (`kohafield`),
1393
  KEY `tab` (`frameworkcode`,`tab`),
1393
  KEY `tab` (`frameworkcode`,`tab`),
1394
  KEY `kohafield` (`frameworkcode`,`kohafield`)
1394
  KEY `kohafield` (`frameworkcode`,`kohafield`)
1395
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1395
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1396
1396
1397
--
1397
--
1398
-- Table structure for table `marc_tag_structure`
1398
-- Table structure for table `marc_tag_structure`
Lines 1408-1414 CREATE TABLE `marc_tag_structure` ( Link Here
1408
  `authorised_value` varchar(10) default NULL,
1408
  `authorised_value` varchar(10) default NULL,
1409
  `frameworkcode` varchar(4) NOT NULL default '',
1409
  `frameworkcode` varchar(4) NOT NULL default '',
1410
  PRIMARY KEY  (`frameworkcode`,`tagfield`)
1410
  PRIMARY KEY  (`frameworkcode`,`tagfield`)
1411
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1411
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1412
1412
1413
--
1413
--
1414
-- Table structure for table `marc_matchers`
1414
-- Table structure for table `marc_matchers`
Lines 1424-1430 CREATE TABLE `marc_matchers` ( Link Here
1424
  PRIMARY KEY (`matcher_id`),
1424
  PRIMARY KEY (`matcher_id`),
1425
  KEY `code` (`code`),
1425
  KEY `code` (`code`),
1426
  KEY `record_type` (`record_type`)
1426
  KEY `record_type` (`record_type`)
1427
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1427
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1428
1428
1429
--
1429
--
1430
-- Table structure for table `matchpoints`
1430
-- Table structure for table `matchpoints`
Lines 1438-1444 CREATE TABLE `matchpoints` ( Link Here
1438
  PRIMARY KEY (`matchpoint_id`),
1438
  PRIMARY KEY (`matchpoint_id`),
1439
  CONSTRAINT `matchpoints_ifbk_1` FOREIGN KEY (`matcher_id`)
1439
  CONSTRAINT `matchpoints_ifbk_1` FOREIGN KEY (`matcher_id`)
1440
  REFERENCES `marc_matchers` (`matcher_id`) ON DELETE CASCADE ON UPDATE CASCADE
1440
  REFERENCES `marc_matchers` (`matcher_id`) ON DELETE CASCADE ON UPDATE CASCADE
1441
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1441
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1442
1442
1443
1443
1444
--
1444
--
Lines 1457-1463 CREATE TABLE `matchpoint_components` ( Link Here
1457
  KEY `by_sequence` (`matchpoint_id`, `sequence`),
1457
  KEY `by_sequence` (`matchpoint_id`, `sequence`),
1458
  CONSTRAINT `matchpoint_components_ifbk_1` FOREIGN KEY (`matchpoint_id`)
1458
  CONSTRAINT `matchpoint_components_ifbk_1` FOREIGN KEY (`matchpoint_id`)
1459
  REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE
1459
  REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE
1460
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1460
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1461
1461
1462
--
1462
--
1463
-- Table structure for table `matcher_component_norms`
1463
-- Table structure for table `matcher_component_norms`
Lines 1470-1476 CREATE TABLE `matchpoint_component_norms` ( Link Here
1470
  KEY `matchpoint_component_norms` (`matchpoint_component_id`, `sequence`),
1470
  KEY `matchpoint_component_norms` (`matchpoint_component_id`, `sequence`),
1471
  CONSTRAINT `matchpoint_component_norms_ifbk_1` FOREIGN KEY (`matchpoint_component_id`)
1471
  CONSTRAINT `matchpoint_component_norms_ifbk_1` FOREIGN KEY (`matchpoint_component_id`)
1472
  REFERENCES `matchpoint_components` (`matchpoint_component_id`) ON DELETE CASCADE ON UPDATE CASCADE
1472
  REFERENCES `matchpoint_components` (`matchpoint_component_id`) ON DELETE CASCADE ON UPDATE CASCADE
1473
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1473
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1474
1474
1475
--
1475
--
1476
-- Table structure for table `matcher_matchpoints`
1476
-- Table structure for table `matcher_matchpoints`
Lines 1483-1489 CREATE TABLE `matcher_matchpoints` ( Link Here
1483
  REFERENCES `marc_matchers` (`matcher_id`) ON DELETE CASCADE ON UPDATE CASCADE,
1483
  REFERENCES `marc_matchers` (`matcher_id`) ON DELETE CASCADE ON UPDATE CASCADE,
1484
  CONSTRAINT `matcher_matchpoints_ifbk_2` FOREIGN KEY (`matchpoint_id`)
1484
  CONSTRAINT `matcher_matchpoints_ifbk_2` FOREIGN KEY (`matchpoint_id`)
1485
  REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE
1485
  REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE
1486
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1486
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1487
1487
1488
--
1488
--
1489
-- Table structure for table `matchchecks`
1489
-- Table structure for table `matchchecks`
Lines 1501-1507 CREATE TABLE `matchchecks` ( Link Here
1501
  REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE,
1501
  REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE,
1502
  CONSTRAINT `matcher_matchchecks_ifbk_3` FOREIGN KEY (`target_matchpoint_id`)
1502
  CONSTRAINT `matcher_matchchecks_ifbk_3` FOREIGN KEY (`target_matchpoint_id`)
1503
  REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE
1503
  REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE
1504
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1504
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1505
1505
1506
--
1506
--
1507
-- Table structure for table `need_merge_authorities`
1507
-- Table structure for table `need_merge_authorities`
Lines 1512-1518 CREATE TABLE `need_merge_authorities` ( -- keeping track of authority records st Link Here
1512
  `id` int NOT NULL auto_increment PRIMARY KEY, -- unique id
1512
  `id` int NOT NULL auto_increment PRIMARY KEY, -- unique id
1513
  `authid` bigint NOT NULL, -- reference to authority record
1513
  `authid` bigint NOT NULL, -- reference to authority record
1514
  `done` tinyint DEFAULT 0  -- indication whether merge has been executed (0=not done, 1= done, 2= in progress)
1514
  `done` tinyint DEFAULT 0  -- indication whether merge has been executed (0=not done, 1= done, 2= in progress)
1515
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1515
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1516
1516
1517
--
1517
--
1518
-- Table structure for table `notifys`
1518
-- Table structure for table `notifys`
Lines 1527-1533 CREATE TABLE `notifys` ( Link Here
1527
  `notify_send_date` date default NULL,
1527
  `notify_send_date` date default NULL,
1528
  `notify_level` int(1) NOT NULL default 0,
1528
  `notify_level` int(1) NOT NULL default 0,
1529
  `method` varchar(20) NOT NULL default ''
1529
  `method` varchar(20) NOT NULL default ''
1530
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1530
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1531
1531
1532
--
1532
--
1533
-- Table structure for table `oai_sets`
1533
-- Table structure for table `oai_sets`
Lines 1539-1545 CREATE TABLE `oai_sets` ( Link Here
1539
  `spec` varchar(80) NOT NULL UNIQUE,
1539
  `spec` varchar(80) NOT NULL UNIQUE,
1540
  `name` varchar(80) NOT NULL,
1540
  `name` varchar(80) NOT NULL,
1541
  PRIMARY KEY (`id`)
1541
  PRIMARY KEY (`id`)
1542
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1542
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1543
1543
1544
--
1544
--
1545
-- Table structure for table `oai_sets_descriptions`
1545
-- Table structure for table `oai_sets_descriptions`
Lines 1550-1556 CREATE TABLE `oai_sets_descriptions` ( Link Here
1550
  `set_id` int(11) NOT NULL,
1550
  `set_id` int(11) NOT NULL,
1551
  `description` varchar(255) NOT NULL,
1551
  `description` varchar(255) NOT NULL,
1552
  CONSTRAINT `oai_sets_descriptions_ibfk_1` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1552
  CONSTRAINT `oai_sets_descriptions_ibfk_1` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1553
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1553
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1554
1554
1555
--
1555
--
1556
-- Table structure for table `oai_sets_mappings`
1556
-- Table structure for table `oai_sets_mappings`
Lines 1564-1570 CREATE TABLE `oai_sets_mappings` ( Link Here
1564
  `operator` varchar(8) NOT NULL default 'equal',
1564
  `operator` varchar(8) NOT NULL default 'equal',
1565
  `marcvalue` varchar(80) NOT NULL,
1565
  `marcvalue` varchar(80) NOT NULL,
1566
  CONSTRAINT `oai_sets_mappings_ibfk_1` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1566
  CONSTRAINT `oai_sets_mappings_ibfk_1` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1567
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1567
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1568
1568
1569
--
1569
--
1570
-- Table structure for table `oai_sets_biblios`
1570
-- Table structure for table `oai_sets_biblios`
Lines 1577-1583 CREATE TABLE `oai_sets_biblios` ( Link Here
1577
  PRIMARY KEY (`biblionumber`, `set_id`),
1577
  PRIMARY KEY (`biblionumber`, `set_id`),
1578
  CONSTRAINT `oai_sets_biblios_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1578
  CONSTRAINT `oai_sets_biblios_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1579
  CONSTRAINT `oai_sets_biblios_ibfk_2` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1579
  CONSTRAINT `oai_sets_biblios_ibfk_2` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1580
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1580
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1581
1581
1582
--
1582
--
1583
-- Table structure for table `old_issues`
1583
-- Table structure for table `old_issues`
Lines 1605-1611 CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r Link Here
1605
    ON DELETE SET NULL ON UPDATE SET NULL,
1605
    ON DELETE SET NULL ON UPDATE SET NULL,
1606
  CONSTRAINT `old_issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1606
  CONSTRAINT `old_issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1607
    ON DELETE SET NULL ON UPDATE SET NULL
1607
    ON DELETE SET NULL ON UPDATE SET NULL
1608
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1608
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1609
1609
1610
--
1610
--
1611
-- Table structure for table `old_reserves`
1611
-- Table structure for table `old_reserves`
Lines 1642-1648 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1642
    ON DELETE SET NULL ON UPDATE SET NULL,
1642
    ON DELETE SET NULL ON UPDATE SET NULL,
1643
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1643
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1644
    ON DELETE SET NULL ON UPDATE SET NULL
1644
    ON DELETE SET NULL ON UPDATE SET NULL
1645
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1645
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1646
1646
1647
--
1647
--
1648
-- Table structure for table `opac_news`
1648
-- Table structure for table `opac_news`
Lines 1661-1667 CREATE TABLE `opac_news` ( -- data from the news tool Link Here
1661
  PRIMARY KEY  (`idnew`),
1661
  PRIMARY KEY  (`idnew`),
1662
  CONSTRAINT opac_news_branchcode_ibfk FOREIGN KEY (branchcode) REFERENCES branches (branchcode)
1662
  CONSTRAINT opac_news_branchcode_ibfk FOREIGN KEY (branchcode) REFERENCES branches (branchcode)
1663
    ON DELETE CASCADE ON UPDATE CASCADE
1663
    ON DELETE CASCADE ON UPDATE CASCADE
1664
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1664
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1665
1665
1666
--
1666
--
1667
-- Table structure for table `overduerules`
1667
-- Table structure for table `overduerules`
Lines 1681-1687 CREATE TABLE `overduerules` ( -- overdue notice status and triggers Link Here
1681
  `letter3` varchar(20) default NULL, -- foreign key from the letter table to define which notice should be sent as the third notice
1681
  `letter3` varchar(20) default NULL, -- foreign key from the letter table to define which notice should be sent as the third notice
1682
  `debarred3` int(1) default 0, -- is the patron restricted when the third notice is sent (1 for yes, 0 for no)
1682
  `debarred3` int(1) default 0, -- is the patron restricted when the third notice is sent (1 for yes, 0 for no)
1683
  PRIMARY KEY  (`branchcode`,`categorycode`)
1683
  PRIMARY KEY  (`branchcode`,`categorycode`)
1684
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1684
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1685
1685
1686
--
1686
--
1687
-- Table structure for table `patroncards`
1687
-- Table structure for table `patroncards`
Lines 1696-1702 CREATE TABLE `patroncards` ( Link Here
1696
   PRIMARY KEY  (`cardid`),
1696
   PRIMARY KEY  (`cardid`),
1697
   KEY `patroncards_ibfk_1` (`borrowernumber`),
1697
   KEY `patroncards_ibfk_1` (`borrowernumber`),
1698
   CONSTRAINT `patroncards_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
1698
   CONSTRAINT `patroncards_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
1699
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1699
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1700
1700
1701
--
1701
--
1702
-- Table structure for table `patronimage`
1702
-- Table structure for table `patronimage`
Lines 1709-1715 CREATE TABLE `patronimage` ( -- information related to patron images Link Here
1709
  `imagefile` mediumblob NOT NULL, -- the image
1709
  `imagefile` mediumblob NOT NULL, -- the image
1710
  PRIMARY KEY  (`borrowernumber`),
1710
  PRIMARY KEY  (`borrowernumber`),
1711
  CONSTRAINT `patronimage_fk1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
1711
  CONSTRAINT `patronimage_fk1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
1712
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1712
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1713
1713
1714
-- Table structure for table `pending_offline_operations`
1714
-- Table structure for table `pending_offline_operations`
1715
--
1715
--
Lines 1727-1733 CREATE TABLE pending_offline_operations ( Link Here
1727
  cardnumber varchar(16) DEFAULT NULL,
1727
  cardnumber varchar(16) DEFAULT NULL,
1728
  amount decimal(28,6) DEFAULT NULL,
1728
  amount decimal(28,6) DEFAULT NULL,
1729
  PRIMARY KEY (operationid)
1729
  PRIMARY KEY (operationid)
1730
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
1730
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1731
1731
1732
1732
1733
--
1733
--
Lines 1740-1746 CREATE TABLE `printers` ( Link Here
1740
  `printqueue` varchar(20) default NULL,
1740
  `printqueue` varchar(20) default NULL,
1741
  `printtype` varchar(20) default NULL,
1741
  `printtype` varchar(20) default NULL,
1742
  PRIMARY KEY  (`printername`)
1742
  PRIMARY KEY  (`printername`)
1743
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1743
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1744
1744
1745
--
1745
--
1746
-- Table structure for table `printers_profile`
1746
-- Table structure for table `printers_profile`
Lines 1760-1766 CREATE TABLE `printers_profile` ( Link Here
1760
  `creator` char(15) NOT NULL DEFAULT 'Labels',
1760
  `creator` char(15) NOT NULL DEFAULT 'Labels',
1761
  PRIMARY KEY  (`profile_id`),
1761
  PRIMARY KEY  (`profile_id`),
1762
  UNIQUE KEY `printername` (`printer_name`,`template_id`,`paper_bin`,`creator`)
1762
  UNIQUE KEY `printername` (`printer_name`,`template_id`,`paper_bin`,`creator`)
1763
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1763
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1764
1764
1765
--
1765
--
1766
-- Table structure for table `repeatable_holidays`
1766
-- Table structure for table `repeatable_holidays`
Lines 1776-1782 CREATE TABLE `repeatable_holidays` ( -- information for the days the library is Link Here
1776
  `title` varchar(50) NOT NULL default '', -- title of this closing
1776
  `title` varchar(50) NOT NULL default '', -- title of this closing
1777
  `description` text NOT NULL, -- description for this closing
1777
  `description` text NOT NULL, -- description for this closing
1778
  PRIMARY KEY  (`id`)
1778
  PRIMARY KEY  (`id`)
1779
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1779
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1780
1780
1781
--
1781
--
1782
-- Table structure for table `reports_dictionary`
1782
-- Table structure for table `reports_dictionary`
Lines 1793-1799 CREATE TABLE reports_dictionary ( -- definitions (or snippets of SQL) stored for Link Here
1793
   report_area varchar(6) DEFAULT NULL, -- Koha module this definition is for Circulation, Catalog, Patrons, Acquistions, Accounts)
1793
   report_area varchar(6) DEFAULT NULL, -- Koha module this definition is for Circulation, Catalog, Patrons, Acquistions, Accounts)
1794
   PRIMARY KEY  (id),
1794
   PRIMARY KEY  (id),
1795
   KEY dictionary_area_idx (report_area)
1795
   KEY dictionary_area_idx (report_area)
1796
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1796
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1797
1797
1798
--
1798
--
1799
-- Table structure for table `reserveconstraints`
1799
-- Table structure for table `reserveconstraints`
Lines 1806-1812 CREATE TABLE `reserveconstraints` ( Link Here
1806
  `biblionumber` int(11) NOT NULL default 0,
1806
  `biblionumber` int(11) NOT NULL default 0,
1807
  `biblioitemnumber` int(11) default NULL,
1807
  `biblioitemnumber` int(11) default NULL,
1808
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
1808
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
1809
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1809
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1810
1810
1811
--
1811
--
1812
-- Table structure for table `reserves`
1812
-- Table structure for table `reserves`
Lines 1843-1849 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1843
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1843
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1844
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1844
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1845
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
1845
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
1846
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1846
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1847
1847
1848
--
1848
--
1849
-- Table structure for table `reviews`
1849
-- Table structure for table `reviews`
Lines 1860-1866 CREATE TABLE `reviews` ( -- patron opac comments Link Here
1860
  PRIMARY KEY  (`reviewid`),
1860
  PRIMARY KEY  (`reviewid`),
1861
  CONSTRAINT `reviews_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
1861
  CONSTRAINT `reviews_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
1862
  CONSTRAINT `reviews_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1862
  CONSTRAINT `reviews_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1863
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1863
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1864
1864
1865
--
1865
--
1866
-- Table structure for table `saved_sql`
1866
-- Table structure for table `saved_sql`
Lines 1885-1891 CREATE TABLE saved_sql ( -- saved sql reports Link Here
1885
   PRIMARY KEY  (`id`),
1885
   PRIMARY KEY  (`id`),
1886
   KEY sql_area_group_idx (report_group, report_subgroup),
1886
   KEY sql_area_group_idx (report_group, report_subgroup),
1887
   KEY boridx (`borrowernumber`)
1887
   KEY boridx (`borrowernumber`)
1888
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1888
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1889
1889
1890
1890
1891
--
1891
--
Lines 1899-1905 CREATE TABLE saved_reports ( Link Here
1899
   `report` longtext,
1899
   `report` longtext,
1900
   `date_run` datetime default NULL,
1900
   `date_run` datetime default NULL,
1901
   PRIMARY KEY  (`id`)
1901
   PRIMARY KEY  (`id`)
1902
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1902
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1903
1903
1904
1904
1905
--
1905
--
Lines 1937-1943 CREATE TABLE `serial` ( Link Here
1937
  `claimdate` date default NULL,
1937
  `claimdate` date default NULL,
1938
  `routingnotes` text,
1938
  `routingnotes` text,
1939
  PRIMARY KEY  (`serialid`)
1939
  PRIMARY KEY  (`serialid`)
1940
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1940
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1941
1941
1942
--
1942
--
1943
-- Table structure for table `sessions`
1943
-- Table structure for table `sessions`
Lines 1948-1954 CREATE TABLE sessions ( Link Here
1948
  `id` varchar(32) NOT NULL,
1948
  `id` varchar(32) NOT NULL,
1949
  `a_session` text NOT NULL,
1949
  `a_session` text NOT NULL,
1950
  PRIMARY KEY (`id`)
1950
  PRIMARY KEY (`id`)
1951
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1951
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1952
1952
1953
--
1953
--
1954
-- Table structure for table `special_holidays`
1954
-- Table structure for table `special_holidays`
Lines 1965-1971 CREATE TABLE `special_holidays` ( -- non repeatable holidays/library closings Link Here
1965
  `title` varchar(50) NOT NULL default '', -- title for this closing
1965
  `title` varchar(50) NOT NULL default '', -- title for this closing
1966
  `description` text NOT NULL, -- description of this closing
1966
  `description` text NOT NULL, -- description of this closing
1967
  PRIMARY KEY  (`id`)
1967
  PRIMARY KEY  (`id`)
1968
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1968
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1969
1969
1970
--
1970
--
1971
-- Table structure for table `statistics`
1971
-- Table structure for table `statistics`
Lines 1995-2001 CREATE TABLE `statistics` ( -- information related to transactions (circulation Link Here
1995
  KEY `borrowernumber_idx` (`borrowernumber`),
1995
  KEY `borrowernumber_idx` (`borrowernumber`),
1996
  KEY `associatedborrower_idx` (`associatedborrower`),
1996
  KEY `associatedborrower_idx` (`associatedborrower`),
1997
  KEY `ccode_idx` (`ccode`)
1997
  KEY `ccode_idx` (`ccode`)
1998
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1998
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1999
1999
2000
--
2000
--
2001
-- Table structure for table `stopwords`
2001
-- Table structure for table `stopwords`
Lines 2004-2010 CREATE TABLE `statistics` ( -- information related to transactions (circulation Link Here
2004
DROP TABLE IF EXISTS `stopwords`;
2004
DROP TABLE IF EXISTS `stopwords`;
2005
  CREATE TABLE `stopwords` (
2005
  CREATE TABLE `stopwords` (
2006
  `word` varchar(255) default NULL
2006
  `word` varchar(255) default NULL
2007
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2007
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2008
2008
2009
--
2009
--
2010
-- Table structure for table subscription_frequencies
2010
-- Table structure for table subscription_frequencies
Lines 2019-2025 CREATE TABLE subscription_frequencies ( Link Here
2019
    unitsperissue INTEGER NOT NULL DEFAULT '1',
2019
    unitsperissue INTEGER NOT NULL DEFAULT '1',
2020
    issuesperunit INTEGER NOT NULL DEFAULT '1',
2020
    issuesperunit INTEGER NOT NULL DEFAULT '1',
2021
    PRIMARY KEY (id)
2021
    PRIMARY KEY (id)
2022
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2022
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2023
2023
2024
--
2024
--
2025
-- Table structure for table subscription_numberpatterns
2025
-- Table structure for table subscription_numberpatterns
Lines 2051-2057 CREATE TABLE subscription_numberpatterns ( Link Here
2051
    setto3 INTEGER DEFAULT NULL,
2051
    setto3 INTEGER DEFAULT NULL,
2052
    numbering3 VARCHAR(255) DEFAULT NULL,
2052
    numbering3 VARCHAR(255) DEFAULT NULL,
2053
    PRIMARY KEY (id)
2053
    PRIMARY KEY (id)
2054
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2054
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2055
2055
2056
--
2056
--
2057
-- Table structure for table `subscription`
2057
-- Table structure for table `subscription`
Lines 2102-2108 CREATE TABLE `subscription` ( Link Here
2102
  PRIMARY KEY  (`subscriptionid`),
2102
  PRIMARY KEY  (`subscriptionid`),
2103
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2103
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2104
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
2104
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
2105
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2105
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2106
2106
2107
--
2107
--
2108
-- Table structure for table `subscriptionhistory`
2108
-- Table structure for table `subscriptionhistory`
Lines 2120-2126 CREATE TABLE `subscriptionhistory` ( Link Here
2120
  `librariannote` varchar(150) NOT NULL default '',
2120
  `librariannote` varchar(150) NOT NULL default '',
2121
  PRIMARY KEY  (`subscriptionid`),
2121
  PRIMARY KEY  (`subscriptionid`),
2122
  KEY `biblionumber` (`biblionumber`)
2122
  KEY `biblionumber` (`biblionumber`)
2123
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2123
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2124
2124
2125
--
2125
--
2126
-- Table structure for table `subscriptionroutinglist`
2126
-- Table structure for table `subscriptionroutinglist`
Lines 2138-2144 CREATE TABLE `subscriptionroutinglist` ( -- information related to the routing l Link Here
2138
    ON DELETE CASCADE ON UPDATE CASCADE,
2138
    ON DELETE CASCADE ON UPDATE CASCADE,
2139
  CONSTRAINT `subscriptionroutinglist_ibfk_2` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`)
2139
  CONSTRAINT `subscriptionroutinglist_ibfk_2` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`)
2140
    ON DELETE CASCADE ON UPDATE CASCADE
2140
    ON DELETE CASCADE ON UPDATE CASCADE
2141
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2141
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2142
2142
2143
--
2143
--
2144
-- Table structure for table `suggestions`
2144
-- Table structure for table `suggestions`
Lines 2181-2187 CREATE TABLE `suggestions` ( -- purchase suggestions Link Here
2181
  PRIMARY KEY  (`suggestionid`),
2181
  PRIMARY KEY  (`suggestionid`),
2182
  KEY `suggestedby` (`suggestedby`),
2182
  KEY `suggestedby` (`suggestedby`),
2183
  KEY `managedby` (`managedby`)
2183
  KEY `managedby` (`managedby`)
2184
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2184
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2185
2185
2186
--
2186
--
2187
-- Table structure for table `systempreferences`
2187
-- Table structure for table `systempreferences`
Lines 2195-2201 CREATE TABLE `systempreferences` ( -- global system preferences Link Here
2195
  `explanation` text, -- descriptive text for the system preference
2195
  `explanation` text, -- descriptive text for the system preference
2196
  `type` varchar(20) default NULL, -- type of question this preference asks (multiple choice, plain text, yes or no, etc)
2196
  `type` varchar(20) default NULL, -- type of question this preference asks (multiple choice, plain text, yes or no, etc)
2197
  PRIMARY KEY  (`variable`)
2197
  PRIMARY KEY  (`variable`)
2198
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2198
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2199
2199
2200
--
2200
--
2201
-- Table structure for table `tags`
2201
-- Table structure for table `tags`
Lines 2206-2212 CREATE TABLE `tags` ( Link Here
2206
  `entry` varchar(255) NOT NULL default '',
2206
  `entry` varchar(255) NOT NULL default '',
2207
  `weight` bigint(20) NOT NULL default 0,
2207
  `weight` bigint(20) NOT NULL default 0,
2208
  PRIMARY KEY  (`entry`)
2208
  PRIMARY KEY  (`entry`)
2209
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2209
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2210
2210
2211
--
2211
--
2212
-- Table structure for table `tags_all`
2212
-- Table structure for table `tags_all`
Lines 2227-2233 CREATE TABLE `tags_all` ( -- all of the tags Link Here
2227
        REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2227
        REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2228
  CONSTRAINT `tags_biblionumber_fk_1` FOREIGN KEY (`biblionumber`)
2228
  CONSTRAINT `tags_biblionumber_fk_1` FOREIGN KEY (`biblionumber`)
2229
        REFERENCES `biblio`     (`biblionumber`)  ON DELETE CASCADE ON UPDATE CASCADE
2229
        REFERENCES `biblio`     (`biblionumber`)  ON DELETE CASCADE ON UPDATE CASCADE
2230
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2230
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2231
2231
2232
--
2232
--
2233
-- Table structure for table `tags_approval`
2233
-- Table structure for table `tags_approval`
Lines 2244-2250 CREATE TABLE `tags_approval` ( -- approved tags Link Here
2244
  KEY `tags_approval_borrowers_fk_1` (`approved_by`),
2244
  KEY `tags_approval_borrowers_fk_1` (`approved_by`),
2245
  CONSTRAINT `tags_approval_borrowers_fk_1` FOREIGN KEY (`approved_by`)
2245
  CONSTRAINT `tags_approval_borrowers_fk_1` FOREIGN KEY (`approved_by`)
2246
        REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
2246
        REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
2247
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2247
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2248
2248
2249
--
2249
--
2250
-- Table structure for table `tags_index`
2250
-- Table structure for table `tags_index`
Lines 2261-2267 CREATE TABLE `tags_index` ( -- a weighted list of all tags and where they are us Link Here
2261
        REFERENCES `tags_approval` (`term`)  ON DELETE CASCADE ON UPDATE CASCADE,
2261
        REFERENCES `tags_approval` (`term`)  ON DELETE CASCADE ON UPDATE CASCADE,
2262
  CONSTRAINT `tags_index_biblionumber_fk_1` FOREIGN KEY (`biblionumber`)
2262
  CONSTRAINT `tags_index_biblionumber_fk_1` FOREIGN KEY (`biblionumber`)
2263
        REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
2263
        REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
2264
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2264
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2265
2265
2266
--
2266
--
2267
-- Table structure for table `userflags`
2267
-- Table structure for table `userflags`
Lines 2274-2280 CREATE TABLE `userflags` ( Link Here
2274
  `flagdesc` varchar(255) default NULL,
2274
  `flagdesc` varchar(255) default NULL,
2275
  `defaulton` int(11) default NULL,
2275
  `defaulton` int(11) default NULL,
2276
  PRIMARY KEY  (`bit`)
2276
  PRIMARY KEY  (`bit`)
2277
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2277
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2278
2278
2279
--
2279
--
2280
-- Table structure for table `virtualshelves`
2280
-- Table structure for table `virtualshelves`
Lines 2293-2299 CREATE TABLE `virtualshelves` ( -- information about lists (or virtual shelves) Link Here
2293
  `allow_delete_other` tinyint(1) default 0, -- permission for deleting entries from list that another person added
2293
  `allow_delete_other` tinyint(1) default 0, -- permission for deleting entries from list that another person added
2294
  PRIMARY KEY  (`shelfnumber`),
2294
  PRIMARY KEY  (`shelfnumber`),
2295
  CONSTRAINT `virtualshelves_ibfk_1` FOREIGN KEY (`owner`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL -- no cascaded delete, please see HandleDelBorrower in VirtualShelves.pm
2295
  CONSTRAINT `virtualshelves_ibfk_1` FOREIGN KEY (`owner`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL -- no cascaded delete, please see HandleDelBorrower in VirtualShelves.pm
2296
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2296
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2297
2297
2298
--
2298
--
2299
-- Table structure for table `virtualshelfcontents`
2299
-- Table structure for table `virtualshelfcontents`
Lines 2311-2317 CREATE TABLE `virtualshelfcontents` ( -- information about the titles in a list Link Here
2311
  CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2311
  CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2312
  CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2312
  CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2313
  CONSTRAINT `shelfcontents_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL -- no cascaded delete, please see HandleDelBorrower in VirtualShelves.pm
2313
  CONSTRAINT `shelfcontents_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL -- no cascaded delete, please see HandleDelBorrower in VirtualShelves.pm
2314
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2314
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2315
2315
2316
--
2316
--
2317
-- Table structure for table `virtualshelfshares`
2317
-- Table structure for table `virtualshelfshares`
Lines 2326-2332 CREATE TABLE `virtualshelfshares` ( -- shared private lists Link Here
2326
  `sharedate` datetime,  -- date of invitation or acceptance of invitation
2326
  `sharedate` datetime,  -- date of invitation or acceptance of invitation
2327
  CONSTRAINT `virtualshelfshares_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2327
  CONSTRAINT `virtualshelfshares_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2328
  CONSTRAINT `virtualshelfshares_ibfk_2` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL -- no cascaded delete, please see HandleDelBorrower in VirtualShelves.pm
2328
  CONSTRAINT `virtualshelfshares_ibfk_2` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL -- no cascaded delete, please see HandleDelBorrower in VirtualShelves.pm
2329
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2329
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2330
2330
2331
--
2331
--
2332
-- Table structure for table `z3950servers`
2332
-- Table structure for table `z3950servers`
Lines 2352-2358 CREATE TABLE `z3950servers` ( -- connection information for the Z39.50 targets u Link Here
2352
  `description` text NOT NULL, -- unused in Koha
2352
  `description` text NOT NULL, -- unused in Koha
2353
  `recordtype` varchar(45) NOT NULL default 'biblio', -- server contains bibliographic or authority records
2353
  `recordtype` varchar(45) NOT NULL default 'biblio', -- server contains bibliographic or authority records
2354
  PRIMARY KEY  (`id`)
2354
  PRIMARY KEY  (`id`)
2355
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2355
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2356
2356
2357
--
2357
--
2358
-- Table structure for table `zebraqueue`
2358
-- Table structure for table `zebraqueue`
Lines 2368-2374 CREATE TABLE `zebraqueue` ( Link Here
2368
  `time` timestamp NOT NULL default CURRENT_TIMESTAMP,
2368
  `time` timestamp NOT NULL default CURRENT_TIMESTAMP,
2369
  PRIMARY KEY  (`id`),
2369
  PRIMARY KEY  (`id`),
2370
  KEY `zebraqueue_lookup` (`server`, `biblio_auth_number`, `operation`, `done`)
2370
  KEY `zebraqueue_lookup` (`server`, `biblio_auth_number`, `operation`, `done`)
2371
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2371
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2372
2372
2373
--
2373
--
2374
-- Table structure for table `services_throttle`
2374
-- Table structure for table `services_throttle`
Lines 2379-2385 CREATE TABLE `services_throttle` ( Link Here
2379
  `service_type` varchar(10) NOT NULL default '',
2379
  `service_type` varchar(10) NOT NULL default '',
2380
  `service_count` varchar(45) default NULL,
2380
  `service_count` varchar(45) default NULL,
2381
  PRIMARY KEY  (`service_type`)
2381
  PRIMARY KEY  (`service_type`)
2382
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2382
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2383
2383
2384
--
2384
--
2385
-- Table structure for table `language_subtag_registry`
2385
-- Table structure for table `language_subtag_registry`
Lines 2396-2402 CREATE TABLE language_subtag_registry ( Link Here
2396
        id int(11) NOT NULL auto_increment,
2396
        id int(11) NOT NULL auto_increment,
2397
        PRIMARY KEY  (`id`),
2397
        PRIMARY KEY  (`id`),
2398
        KEY `subtag` (`subtag`)
2398
        KEY `subtag` (`subtag`)
2399
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2399
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2400
2400
2401
--
2401
--
2402
-- Table structure for table `language_rfc4646_to_iso639`
2402
-- Table structure for table `language_rfc4646_to_iso639`
Lines 2412-2418 CREATE TABLE language_rfc4646_to_iso639 ( Link Here
2412
        id int(11) NOT NULL auto_increment,
2412
        id int(11) NOT NULL auto_increment,
2413
        PRIMARY KEY  (`id`),
2413
        PRIMARY KEY  (`id`),
2414
        KEY `rfc4646_subtag` (`rfc4646_subtag`)
2414
        KEY `rfc4646_subtag` (`rfc4646_subtag`)
2415
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2415
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2416
2416
2417
--
2417
--
2418
-- Table structure for table `language_descriptions`
2418
-- Table structure for table `language_descriptions`
Lines 2428-2434 CREATE TABLE language_descriptions ( Link Here
2428
        PRIMARY KEY  (`id`),
2428
        PRIMARY KEY  (`id`),
2429
        KEY `lang` (`lang`),
2429
        KEY `lang` (`lang`),
2430
        KEY `subtag_type_lang` (`subtag`, `type`, `lang`)
2430
        KEY `subtag_type_lang` (`subtag`, `type`, `lang`)
2431
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2431
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2432
2432
2433
--
2433
--
2434
-- Table structure for table `language_script_bidi`
2434
-- Table structure for table `language_script_bidi`
Lines 2440-2446 CREATE TABLE language_script_bidi ( Link Here
2440
        rfc4646_subtag varchar(25), -- script subtag, Arab, Hebr, etc.
2440
        rfc4646_subtag varchar(25), -- script subtag, Arab, Hebr, etc.
2441
        bidi varchar(3), -- rtl ltr
2441
        bidi varchar(3), -- rtl ltr
2442
        KEY `rfc4646_subtag` (`rfc4646_subtag`)
2442
        KEY `rfc4646_subtag` (`rfc4646_subtag`)
2443
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2443
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2444
2444
2445
--
2445
--
2446
-- Table structure for table `language_script_mapping`
2446
-- Table structure for table `language_script_mapping`
Lines 2453-2459 CREATE TABLE language_script_mapping ( Link Here
2453
        language_subtag varchar(25),
2453
        language_subtag varchar(25),
2454
        script_subtag varchar(25),
2454
        script_subtag varchar(25),
2455
        KEY `language_subtag` (`language_subtag`)
2455
        KEY `language_subtag` (`language_subtag`)
2456
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2456
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2457
2457
2458
--
2458
--
2459
-- Table structure for table `permissions`
2459
-- Table structure for table `permissions`
Lines 2467-2473 CREATE TABLE `permissions` ( Link Here
2467
  PRIMARY KEY  (`module_bit`, `code`),
2467
  PRIMARY KEY  (`module_bit`, `code`),
2468
  CONSTRAINT `permissions_ibfk_1` FOREIGN KEY (`module_bit`) REFERENCES `userflags` (`bit`)
2468
  CONSTRAINT `permissions_ibfk_1` FOREIGN KEY (`module_bit`) REFERENCES `userflags` (`bit`)
2469
    ON DELETE CASCADE ON UPDATE CASCADE
2469
    ON DELETE CASCADE ON UPDATE CASCADE
2470
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2470
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2471
2471
2472
--
2472
--
2473
-- Table structure for table `serialitems`
2473
-- Table structure for table `serialitems`
Lines 2481-2487 CREATE TABLE `serialitems` ( Link Here
2481
	KEY `serialitems_sfk_1` (`serialid`),
2481
	KEY `serialitems_sfk_1` (`serialid`),
2482
	CONSTRAINT `serialitems_sfk_1` FOREIGN KEY (`serialid`) REFERENCES `serial` (`serialid`) ON DELETE CASCADE ON UPDATE CASCADE,
2482
	CONSTRAINT `serialitems_sfk_1` FOREIGN KEY (`serialid`) REFERENCES `serial` (`serialid`) ON DELETE CASCADE ON UPDATE CASCADE,
2483
	CONSTRAINT `serialitems_sfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
2483
	CONSTRAINT `serialitems_sfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
2484
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2484
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2485
2485
2486
--
2486
--
2487
-- Table structure for table `user_permissions`
2487
-- Table structure for table `user_permissions`
Lines 2496-2502 CREATE TABLE `user_permissions` ( Link Here
2496
    ON DELETE CASCADE ON UPDATE CASCADE,
2496
    ON DELETE CASCADE ON UPDATE CASCADE,
2497
  CONSTRAINT `user_permissions_ibfk_2` FOREIGN KEY (`module_bit`, `code`) REFERENCES `permissions` (`module_bit`, `code`)
2497
  CONSTRAINT `user_permissions_ibfk_2` FOREIGN KEY (`module_bit`, `code`) REFERENCES `permissions` (`module_bit`, `code`)
2498
    ON DELETE CASCADE ON UPDATE CASCADE
2498
    ON DELETE CASCADE ON UPDATE CASCADE
2499
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2499
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2500
2500
2501
--
2501
--
2502
-- Table structure for table `tmp_holdsqueue`
2502
-- Table structure for table `tmp_holdsqueue`
Lines 2519-2525 CREATE TABLE `tmp_holdsqueue` ( Link Here
2519
  `pickbranch` varchar(10) default NULL,
2519
  `pickbranch` varchar(10) default NULL,
2520
  `notes` text,
2520
  `notes` text,
2521
  `item_level_request` tinyint(4) NOT NULL default 0
2521
  `item_level_request` tinyint(4) NOT NULL default 0
2522
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2522
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2523
2523
2524
--
2524
--
2525
-- Table structure for table `message_queue`
2525
-- Table structure for table `message_queue`
Lines 2544-2550 CREATE TABLE `message_queue` ( Link Here
2544
  KEY `message_transport_type` (`message_transport_type`),
2544
  KEY `message_transport_type` (`message_transport_type`),
2545
  CONSTRAINT `messageq_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2545
  CONSTRAINT `messageq_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2546
  CONSTRAINT `messageq_ibfk_2` FOREIGN KEY (`message_transport_type`) REFERENCES `message_transport_types` (`message_transport_type`) ON DELETE RESTRICT ON UPDATE CASCADE
2546
  CONSTRAINT `messageq_ibfk_2` FOREIGN KEY (`message_transport_type`) REFERENCES `message_transport_types` (`message_transport_type`) ON DELETE RESTRICT ON UPDATE CASCADE
2547
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2547
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2548
2548
2549
--
2549
--
2550
-- Table structure for table `message_transport_types`
2550
-- Table structure for table `message_transport_types`
Lines 2554-2560 DROP TABLE IF EXISTS `message_transport_types`; Link Here
2554
CREATE TABLE `message_transport_types` (
2554
CREATE TABLE `message_transport_types` (
2555
  `message_transport_type` varchar(20) NOT NULL,
2555
  `message_transport_type` varchar(20) NOT NULL,
2556
  PRIMARY KEY  (`message_transport_type`)
2556
  PRIMARY KEY  (`message_transport_type`)
2557
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2557
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2558
2558
2559
--
2559
--
2560
-- Table structure for table `overduerules_transport_types`
2560
-- Table structure for table `overduerules_transport_types`
Lines 2570-2576 CREATE TABLE overduerules_transport_types( Link Here
2570
    PRIMARY KEY (id),
2570
    PRIMARY KEY (id),
2571
    CONSTRAINT overduerules_fk FOREIGN KEY (branchcode, categorycode) REFERENCES overduerules (branchcode, categorycode) ON DELETE CASCADE ON UPDATE CASCADE,
2571
    CONSTRAINT overduerules_fk FOREIGN KEY (branchcode, categorycode) REFERENCES overduerules (branchcode, categorycode) ON DELETE CASCADE ON UPDATE CASCADE,
2572
    CONSTRAINT mtt_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types (message_transport_type) ON DELETE CASCADE ON UPDATE CASCADE
2572
    CONSTRAINT mtt_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types (message_transport_type) ON DELETE CASCADE ON UPDATE CASCADE
2573
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2573
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2574
2574
2575
--
2575
--
2576
-- Table structure for table `message_attributes`
2576
-- Table structure for table `message_attributes`
Lines 2583-2589 CREATE TABLE `message_attributes` ( Link Here
2583
  `takes_days` tinyint(1) NOT NULL default '0',
2583
  `takes_days` tinyint(1) NOT NULL default '0',
2584
  PRIMARY KEY  (`message_attribute_id`),
2584
  PRIMARY KEY  (`message_attribute_id`),
2585
  UNIQUE KEY `message_name` (`message_name`)
2585
  UNIQUE KEY `message_name` (`message_name`)
2586
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2586
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2587
2587
2588
--
2588
--
2589
-- Table structure for table `message_transports`
2589
-- Table structure for table `message_transports`
Lines 2603-2609 CREATE TABLE `message_transports` ( Link Here
2603
  CONSTRAINT `message_transports_ibfk_1` FOREIGN KEY (`message_attribute_id`) REFERENCES `message_attributes` (`message_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2603
  CONSTRAINT `message_transports_ibfk_1` FOREIGN KEY (`message_attribute_id`) REFERENCES `message_attributes` (`message_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2604
  CONSTRAINT `message_transports_ibfk_2` FOREIGN KEY (`message_transport_type`) REFERENCES `message_transport_types` (`message_transport_type`) ON DELETE CASCADE ON UPDATE CASCADE,
2604
  CONSTRAINT `message_transports_ibfk_2` FOREIGN KEY (`message_transport_type`) REFERENCES `message_transport_types` (`message_transport_type`) ON DELETE CASCADE ON UPDATE CASCADE,
2605
  CONSTRAINT `message_transports_ibfk_3` FOREIGN KEY (`letter_module`, `letter_code`, `branchcode`) REFERENCES `letter` (`module`, `code`, `branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
2605
  CONSTRAINT `message_transports_ibfk_3` FOREIGN KEY (`letter_module`, `letter_code`, `branchcode`) REFERENCES `letter` (`module`, `code`, `branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
2606
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2606
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2607
2607
2608
--
2608
--
2609
-- Table structure for table `borrower_files`
2609
-- Table structure for table `borrower_files`
Lines 2621-2627 CREATE TABLE IF NOT EXISTS `borrower_files` ( -- files attached to the patron/bo Link Here
2621
  PRIMARY KEY (`file_id`),
2621
  PRIMARY KEY (`file_id`),
2622
  KEY `borrowernumber` (`borrowernumber`),
2622
  KEY `borrowernumber` (`borrowernumber`),
2623
  CONSTRAINT borrower_files_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
2623
  CONSTRAINT borrower_files_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
2624
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2624
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2625
2625
2626
--
2626
--
2627
-- Table structure for table `borrower_message_preferences`
2627
-- Table structure for table `borrower_message_preferences`
Lines 2642-2648 CREATE TABLE `borrower_message_preferences` ( Link Here
2642
  CONSTRAINT `borrower_message_preferences_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2642
  CONSTRAINT `borrower_message_preferences_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2643
  CONSTRAINT `borrower_message_preferences_ibfk_2` FOREIGN KEY (`message_attribute_id`) REFERENCES `message_attributes` (`message_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2643
  CONSTRAINT `borrower_message_preferences_ibfk_2` FOREIGN KEY (`message_attribute_id`) REFERENCES `message_attributes` (`message_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2644
  CONSTRAINT `borrower_message_preferences_ibfk_3` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE
2644
  CONSTRAINT `borrower_message_preferences_ibfk_3` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE
2645
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2645
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2646
2646
2647
--
2647
--
2648
-- Table structure for table `borrower_message_transport_preferences`
2648
-- Table structure for table `borrower_message_transport_preferences`
Lines 2656-2662 CREATE TABLE `borrower_message_transport_preferences` ( Link Here
2656
  KEY `message_transport_type` (`message_transport_type`),
2656
  KEY `message_transport_type` (`message_transport_type`),
2657
  CONSTRAINT `borrower_message_transport_preferences_ibfk_1` FOREIGN KEY (`borrower_message_preference_id`) REFERENCES `borrower_message_preferences` (`borrower_message_preference_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2657
  CONSTRAINT `borrower_message_transport_preferences_ibfk_1` FOREIGN KEY (`borrower_message_preference_id`) REFERENCES `borrower_message_preferences` (`borrower_message_preference_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2658
  CONSTRAINT `borrower_message_transport_preferences_ibfk_2` FOREIGN KEY (`message_transport_type`) REFERENCES `message_transport_types` (`message_transport_type`) ON DELETE CASCADE ON UPDATE CASCADE
2658
  CONSTRAINT `borrower_message_transport_preferences_ibfk_2` FOREIGN KEY (`message_transport_type`) REFERENCES `message_transport_types` (`message_transport_type`) ON DELETE CASCADE ON UPDATE CASCADE
2659
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2659
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2660
2660
2661
--
2661
--
2662
-- Table structure for the table branch_transfer_limits
2662
-- Table structure for the table branch_transfer_limits
Lines 2670-2676 CREATE TABLE branch_transfer_limits ( Link Here
2670
    itemtype varchar(10) NULL,
2670
    itemtype varchar(10) NULL,
2671
    ccode varchar(10) NULL,
2671
    ccode varchar(10) NULL,
2672
    PRIMARY KEY  (limitId)
2672
    PRIMARY KEY  (limitId)
2673
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2673
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2674
2674
2675
--
2675
--
2676
-- Table structure for table `item_circulation_alert_preferences`
2676
-- Table structure for table `item_circulation_alert_preferences`
Lines 2685-2691 CREATE TABLE `item_circulation_alert_preferences` ( Link Here
2685
  `notification` varchar(16) NOT NULL,
2685
  `notification` varchar(16) NOT NULL,
2686
  PRIMARY KEY  (`id`),
2686
  PRIMARY KEY  (`id`),
2687
  KEY `branchcode` (`branchcode`,`categorycode`,`item_type`, `notification`)
2687
  KEY `branchcode` (`branchcode`,`categorycode`,`item_type`, `notification`)
2688
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2688
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2689
2689
2690
--
2690
--
2691
-- Table structure for table `messages`
2691
-- Table structure for table `messages`
Lines 2699-2705 CREATE TABLE `messages` ( -- circulation messages left via the patron's check ou Link Here
2699
  `message` text NOT NULL, -- the text of the message
2699
  `message` text NOT NULL, -- the text of the message
2700
  `message_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- the date and time the message was written
2700
  `message_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- the date and time the message was written
2701
  PRIMARY KEY (`message_id`)
2701
  PRIMARY KEY (`message_id`)
2702
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2702
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2703
2703
2704
--
2704
--
2705
-- Table structure for table `accountlines`
2705
-- Table structure for table `accountlines`
Lines 2729-2735 CREATE TABLE `accountlines` ( Link Here
2729
  KEY `itemnumber` (`itemnumber`),
2729
  KEY `itemnumber` (`itemnumber`),
2730
  CONSTRAINT `accountlines_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2730
  CONSTRAINT `accountlines_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2731
  CONSTRAINT `accountlines_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL
2731
  CONSTRAINT `accountlines_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL
2732
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2732
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2733
2733
2734
--
2734
--
2735
-- Table structure for table `accountoffsets`
2735
-- Table structure for table `accountoffsets`
Lines 2743-2749 CREATE TABLE `accountoffsets` ( Link Here
2743
  `offsetamount` decimal(28,6) default NULL,
2743
  `offsetamount` decimal(28,6) default NULL,
2744
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2744
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2745
  CONSTRAINT `accountoffsets_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
2745
  CONSTRAINT `accountoffsets_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
2746
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2746
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2747
2747
2748
--
2748
--
2749
-- Table structure for table `action_logs`
2749
-- Table structure for table `action_logs`
Lines 2765-2771 CREATE TABLE `action_logs` ( -- logs of actions taken in Koha (requires that the Link Here
2765
  KEY `action_idx` (`action`(255)),
2765
  KEY `action_idx` (`action`(255)),
2766
  KEY `object_idx` (`object`),
2766
  KEY `object_idx` (`object`),
2767
  KEY `info_idx` (`info`(255))
2767
  KEY `info_idx` (`info`(255))
2768
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2768
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2769
2769
2770
--
2770
--
2771
-- Table structure for table `alert`
2771
-- Table structure for table `alert`
Lines 2780-2786 CREATE TABLE `alert` ( Link Here
2780
  PRIMARY KEY  (`alertid`),
2780
  PRIMARY KEY  (`alertid`),
2781
  KEY `borrowernumber` (`borrowernumber`),
2781
  KEY `borrowernumber` (`borrowernumber`),
2782
  KEY `type` (`type`,`externalid`)
2782
  KEY `type` (`type`,`externalid`)
2783
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2783
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2784
2784
2785
--
2785
--
2786
-- Table structure for table `aqbasketgroups`
2786
-- Table structure for table `aqbasketgroups`
Lines 2799-2805 CREATE TABLE `aqbasketgroups` ( Link Here
2799
  PRIMARY KEY  (`id`),
2799
  PRIMARY KEY  (`id`),
2800
  KEY `booksellerid` (`booksellerid`),
2800
  KEY `booksellerid` (`booksellerid`),
2801
  CONSTRAINT `aqbasketgroups_ibfk_1` FOREIGN KEY (`booksellerid`) REFERENCES `aqbooksellers` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
2801
  CONSTRAINT `aqbasketgroups_ibfk_1` FOREIGN KEY (`booksellerid`) REFERENCES `aqbooksellers` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
2802
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2802
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2803
2803
2804
--
2804
--
2805
-- Table structure for table `aqbasket`
2805
-- Table structure for table `aqbasket`
Lines 2829-2835 CREATE TABLE `aqbasket` ( -- stores data about baskets in acquisitions Link Here
2829
  CONSTRAINT `aqbasket_ibfk_2` FOREIGN KEY (`contractnumber`) REFERENCES `aqcontract` (`contractnumber`),
2829
  CONSTRAINT `aqbasket_ibfk_2` FOREIGN KEY (`contractnumber`) REFERENCES `aqcontract` (`contractnumber`),
2830
  CONSTRAINT `aqbasket_ibfk_3` FOREIGN KEY (`basketgroupid`) REFERENCES `aqbasketgroups` (`id`) ON UPDATE CASCADE,
2830
  CONSTRAINT `aqbasket_ibfk_3` FOREIGN KEY (`basketgroupid`) REFERENCES `aqbasketgroups` (`id`) ON UPDATE CASCADE,
2831
  CONSTRAINT aqbasket_ibfk_4 FOREIGN KEY (branch) REFERENCES branches (branchcode) ON UPDATE CASCADE ON DELETE SET NULL
2831
  CONSTRAINT aqbasket_ibfk_4 FOREIGN KEY (branch) REFERENCES branches (branchcode) ON UPDATE CASCADE ON DELETE SET NULL
2832
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2832
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2833
2833
2834
--
2834
--
2835
-- Table structure for table aqbasketusers
2835
-- Table structure for table aqbasketusers
Lines 2842-2848 CREATE TABLE aqbasketusers ( Link Here
2842
  PRIMARY KEY (basketno,borrowernumber),
2842
  PRIMARY KEY (basketno,borrowernumber),
2843
  CONSTRAINT aqbasketusers_ibfk_1 FOREIGN KEY (basketno) REFERENCES aqbasket (basketno) ON UPDATE CASCADE ON DELETE CASCADE,
2843
  CONSTRAINT aqbasketusers_ibfk_1 FOREIGN KEY (basketno) REFERENCES aqbasket (basketno) ON UPDATE CASCADE ON DELETE CASCADE,
2844
  CONSTRAINT aqbasketusers_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON UPDATE CASCADE ON DELETE CASCADE
2844
  CONSTRAINT aqbasketusers_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON UPDATE CASCADE ON DELETE CASCADE
2845
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2845
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2846
2846
2847
--
2847
--
2848
-- Table structure for table `aqbooksellers`
2848
-- Table structure for table `aqbooksellers`
Lines 2888-2894 CREATE TABLE `aqbooksellers` ( -- information about the vendors listed in acquis Link Here
2888
  KEY `invoiceprice` (`invoiceprice`),
2888
  KEY `invoiceprice` (`invoiceprice`),
2889
  CONSTRAINT `aqbooksellers_ibfk_1` FOREIGN KEY (`listprice`) REFERENCES `currency` (`currency`) ON DELETE CASCADE ON UPDATE CASCADE,
2889
  CONSTRAINT `aqbooksellers_ibfk_1` FOREIGN KEY (`listprice`) REFERENCES `currency` (`currency`) ON DELETE CASCADE ON UPDATE CASCADE,
2890
  CONSTRAINT `aqbooksellers_ibfk_2` FOREIGN KEY (`invoiceprice`) REFERENCES `currency` (`currency`) ON DELETE CASCADE ON UPDATE CASCADE
2890
  CONSTRAINT `aqbooksellers_ibfk_2` FOREIGN KEY (`invoiceprice`) REFERENCES `currency` (`currency`) ON DELETE CASCADE ON UPDATE CASCADE
2891
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2891
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2892
2892
2893
--
2893
--
2894
-- Table structure for table `aqbudgets`
2894
-- Table structure for table `aqbudgets`
Lines 2912-2918 CREATE TABLE `aqbudgets` ( -- information related to Funds Link Here
2912
  `budget_owner_id` int(11) default NULL, -- borrowernumber of the person who owns this fund (borrowers.borrowernumber)
2912
  `budget_owner_id` int(11) default NULL, -- borrowernumber of the person who owns this fund (borrowers.borrowernumber)
2913
  `budget_permission` int(1) default '0', -- level of permission for this fund (used only by the owner, only by the library, or anyone)
2913
  `budget_permission` int(1) default '0', -- level of permission for this fund (used only by the owner, only by the library, or anyone)
2914
  PRIMARY KEY  (`budget_id`)
2914
  PRIMARY KEY  (`budget_id`)
2915
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2915
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2916
2916
2917
--
2917
--
2918
-- Table structure for table aqbudgetborrowers
2918
-- Table structure for table aqbudgetborrowers
Lines 2929-2935 CREATE TABLE aqbudgetborrowers ( Link Here
2929
  CONSTRAINT aqbudgetborrowers_ibfk_2 FOREIGN KEY (borrowernumber)
2929
  CONSTRAINT aqbudgetborrowers_ibfk_2 FOREIGN KEY (borrowernumber)
2930
    REFERENCES borrowers (borrowernumber)
2930
    REFERENCES borrowers (borrowernumber)
2931
    ON DELETE CASCADE ON UPDATE CASCADE
2931
    ON DELETE CASCADE ON UPDATE CASCADE
2932
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2932
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2933
2933
2934
--
2934
--
2935
-- Table structure for table `aqbudgetperiods`
2935
-- Table structure for table `aqbudgetperiods`
Lines 2948-2954 CREATE TABLE `aqbudgetperiods` ( -- information related to Budgets Link Here
2948
  `sort1_authcat` varchar(10) default NULL, -- statistical category for this budget
2948
  `sort1_authcat` varchar(10) default NULL, -- statistical category for this budget
2949
  `sort2_authcat` varchar(10) default NULL, -- second statistical category for this budget
2949
  `sort2_authcat` varchar(10) default NULL, -- second statistical category for this budget
2950
  PRIMARY KEY  (`budget_period_id`)
2950
  PRIMARY KEY  (`budget_period_id`)
2951
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2951
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2952
2952
2953
--
2953
--
2954
-- Table structure for table `aqbudgets_planning`
2954
-- Table structure for table `aqbudgets_planning`
Lines 2965-2971 CREATE TABLE `aqbudgets_planning` ( Link Here
2965
  `display` tinyint(1) DEFAULT 1,
2965
  `display` tinyint(1) DEFAULT 1,
2966
  PRIMARY KEY  (`plan_id`),
2966
  PRIMARY KEY  (`plan_id`),
2967
  CONSTRAINT `aqbudgets_planning_ifbk_1` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE
2967
  CONSTRAINT `aqbudgets_planning_ifbk_1` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE
2968
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2968
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2969
2969
2970
--
2970
--
2971
-- Table structure for table 'aqcontract'
2971
-- Table structure for table 'aqcontract'
Lines 3035-3041 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
3035
  CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3035
  CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3036
  CONSTRAINT aqorders_ibfk_3 FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE SET NULL ON UPDATE CASCADE,
3036
  CONSTRAINT aqorders_ibfk_3 FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE SET NULL ON UPDATE CASCADE,
3037
  CONSTRAINT `aqorders_subscriptionid` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE
3037
  CONSTRAINT `aqorders_subscriptionid` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE
3038
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3038
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3039
3039
3040
3040
3041
--
3041
--
Lines 3050-3056 CREATE TABLE `aqorders_items` ( -- information on items entered in the acquisiti Link Here
3050
  PRIMARY KEY  (`itemnumber`),
3050
  PRIMARY KEY  (`itemnumber`),
3051
  KEY `ordernumber` (`ordernumber`),
3051
  KEY `ordernumber` (`ordernumber`),
3052
  CONSTRAINT aqorders_items_ibfk_1 FOREIGN KEY (ordernumber) REFERENCES aqorders (ordernumber) ON DELETE CASCADE ON UPDATE CASCADE
3052
  CONSTRAINT aqorders_items_ibfk_1 FOREIGN KEY (ordernumber) REFERENCES aqorders (ordernumber) ON DELETE CASCADE ON UPDATE CASCADE
3053
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3053
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3054
3054
3055
3055
3056
--
3056
--
Lines 3066-3072 CREATE TABLE aqorders_transfers ( Link Here
3066
  UNIQUE KEY ordernumber_to (ordernumber_to),
3066
  UNIQUE KEY ordernumber_to (ordernumber_to),
3067
  CONSTRAINT aqorders_transfers_ordernumber_from FOREIGN KEY (ordernumber_from) REFERENCES aqorders (ordernumber) ON DELETE SET NULL ON UPDATE CASCADE,
3067
  CONSTRAINT aqorders_transfers_ordernumber_from FOREIGN KEY (ordernumber_from) REFERENCES aqorders (ordernumber) ON DELETE SET NULL ON UPDATE CASCADE,
3068
  CONSTRAINT aqorders_transfers_ordernumber_to FOREIGN KEY (ordernumber_to) REFERENCES aqorders (ordernumber) ON DELETE SET NULL ON UPDATE CASCADE
3068
  CONSTRAINT aqorders_transfers_ordernumber_to FOREIGN KEY (ordernumber_to) REFERENCES aqorders (ordernumber) ON DELETE SET NULL ON UPDATE CASCADE
3069
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3069
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3070
3070
3071
--
3071
--
3072
-- Table structure for table aqinvoices
3072
-- Table structure for table aqinvoices
Lines 3085-3091 CREATE TABLE aqinvoices ( Link Here
3085
  PRIMARY KEY (invoiceid),
3085
  PRIMARY KEY (invoiceid),
3086
  CONSTRAINT aqinvoices_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE,
3086
  CONSTRAINT aqinvoices_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE,
3087
  CONSTRAINT aqinvoices_fk_shipmentcost_budgetid FOREIGN KEY (shipmentcost_budgetid) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE
3087
  CONSTRAINT aqinvoices_fk_shipmentcost_budgetid FOREIGN KEY (shipmentcost_budgetid) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE
3088
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3088
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3089
3089
3090
3090
3091
--
3091
--
Lines 3100-3106 CREATE TABLE `fieldmapping` ( -- koha to keyword mapping Link Here
3100
  `fieldcode` char(3) NOT NULL, -- marc field number to map to this keyword
3100
  `fieldcode` char(3) NOT NULL, -- marc field number to map to this keyword
3101
  `subfieldcode` char(1) NOT NULL, -- marc subfield associated with the fieldcode to map to this keyword
3101
  `subfieldcode` char(1) NOT NULL, -- marc subfield associated with the fieldcode to map to this keyword
3102
  PRIMARY KEY  (`id`)
3102
  PRIMARY KEY  (`id`)
3103
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3103
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3104
3104
3105
--
3105
--
3106
-- Table structure for table `transport_cost`
3106
-- Table structure for table `transport_cost`
Lines 3116-3122 CREATE TABLE transport_cost ( Link Here
3116
      PRIMARY KEY (frombranch, tobranch),
3116
      PRIMARY KEY (frombranch, tobranch),
3117
      CONSTRAINT transport_cost_ibfk_1 FOREIGN KEY (frombranch) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE,
3117
      CONSTRAINT transport_cost_ibfk_1 FOREIGN KEY (frombranch) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE,
3118
      CONSTRAINT transport_cost_ibfk_2 FOREIGN KEY (tobranch) REFERENCES branches (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
3118
      CONSTRAINT transport_cost_ibfk_2 FOREIGN KEY (tobranch) REFERENCES branches (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
3119
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3119
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3120
3120
3121
--
3121
--
3122
-- Table structure for table `biblioimages`
3122
-- Table structure for table `biblioimages`
Lines 3132-3138 CREATE TABLE `biblioimages` ( -- local cover images Link Here
3132
 `thumbnail` mediumblob NOT NULL, -- thumbnail file contents
3132
 `thumbnail` mediumblob NOT NULL, -- thumbnail file contents
3133
 PRIMARY KEY (`imagenumber`),
3133
 PRIMARY KEY (`imagenumber`),
3134
 CONSTRAINT `bibliocoverimage_fk1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
3134
 CONSTRAINT `bibliocoverimage_fk1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
3135
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3135
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3136
3136
3137
--
3137
--
3138
-- Table structure for table `social_data`
3138
-- Table structure for table `social_data`
Lines 3148-3154 CREATE TABLE IF NOT EXISTS `social_data` ( Link Here
3148
  `score_avg` DECIMAL(5,2),
3148
  `score_avg` DECIMAL(5,2),
3149
  `num_scores` INT,
3149
  `num_scores` INT,
3150
  PRIMARY KEY  (`isbn`)
3150
  PRIMARY KEY  (`isbn`)
3151
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3151
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3152
3152
3153
--
3153
--
3154
-- 'Ratings' table. This tracks the star ratings set by borrowers.
3154
-- 'Ratings' table. This tracks the star ratings set by borrowers.
Lines 3163-3169 CREATE TABLE ratings ( -- information related to the star ratings in the OPAC Link Here
3163
    PRIMARY KEY  (borrowernumber,biblionumber),
3163
    PRIMARY KEY  (borrowernumber,biblionumber),
3164
    CONSTRAINT ratings_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
3164
    CONSTRAINT ratings_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
3165
    CONSTRAINT ratings_ibfk_2 FOREIGN KEY (biblionumber) REFERENCES biblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE
3165
    CONSTRAINT ratings_ibfk_2 FOREIGN KEY (biblionumber) REFERENCES biblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE
3166
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3166
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3167
3167
3168
--
3168
--
3169
-- Table structure for table `quotes`
3169
-- Table structure for table `quotes`
Lines 3176-3182 CREATE TABLE `quotes` ( -- data for the quote of the day feature Link Here
3176
  `text` mediumtext NOT NULL, -- text of the quote
3176
  `text` mediumtext NOT NULL, -- text of the quote
3177
  `timestamp` datetime NOT NULL, -- date and time that the quote last appeared in the opac
3177
  `timestamp` datetime NOT NULL, -- date and time that the quote last appeared in the opac
3178
  PRIMARY KEY (`id`)
3178
  PRIMARY KEY (`id`)
3179
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3179
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3180
3180
3181
--
3181
--
3182
-- Table structure for table categories_branches
3182
-- Table structure for table categories_branches
Lines 3188-3194 CREATE TABLE categories_branches( -- association table between categories and br Link Here
3188
    branchcode VARCHAR(10),
3188
    branchcode VARCHAR(10),
3189
    FOREIGN KEY (categorycode) REFERENCES categories(categorycode) ON DELETE CASCADE,
3189
    FOREIGN KEY (categorycode) REFERENCES categories(categorycode) ON DELETE CASCADE,
3190
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
3190
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
3191
) ENGINE=INNODB DEFAULT CHARSET=utf8;
3191
) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3192
3192
3193
--
3193
--
3194
-- Table structure for table authorised_values_branches
3194
-- Table structure for table authorised_values_branches
Lines 3200-3206 CREATE TABLE authorised_values_branches( -- association table between authorised Link Here
3200
    branchcode VARCHAR(10),
3200
    branchcode VARCHAR(10),
3201
    FOREIGN KEY (av_id) REFERENCES authorised_values(id) ON DELETE CASCADE,
3201
    FOREIGN KEY (av_id) REFERENCES authorised_values(id) ON DELETE CASCADE,
3202
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
3202
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
3203
) ENGINE=INNODB DEFAULT CHARSET=utf8;
3203
) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3204
3204
3205
3205
3206
--
3206
--
Lines 3213-3219 CREATE TABLE borrower_attribute_types_branches( -- association table between bor Link Here
3213
    b_branchcode VARCHAR(10),
3213
    b_branchcode VARCHAR(10),
3214
    FOREIGN KEY (bat_code) REFERENCES borrower_attribute_types(code) ON DELETE CASCADE,
3214
    FOREIGN KEY (bat_code) REFERENCES borrower_attribute_types(code) ON DELETE CASCADE,
3215
    FOREIGN KEY (b_branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
3215
    FOREIGN KEY (b_branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
3216
) ENGINE=INNODB DEFAULT CHARSET=utf8;
3216
) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3217
3217
3218
--
3218
--
3219
-- Table structure for table `borrower_modifications`
3219
-- Table structure for table `borrower_modifications`
Lines 3292-3298 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3292
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3292
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3293
  KEY `verification_token` (`verification_token`),
3293
  KEY `verification_token` (`verification_token`),
3294
  KEY `borrowernumber` (`borrowernumber`)
3294
  KEY `borrowernumber` (`borrowernumber`)
3295
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3295
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3296
3296
3297
--
3297
--
3298
-- Table structure for table linktracker
3298
-- Table structure for table linktracker
Lines 3312-3318 CREATE TABLE linktracker ( Link Here
3312
   KEY itemidx (itemnumber),
3312
   KEY itemidx (itemnumber),
3313
   KEY borridx (borrowernumber),
3313
   KEY borridx (borrowernumber),
3314
   KEY dateidx (timeclicked)
3314
   KEY dateidx (timeclicked)
3315
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3315
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3316
3316
3317
--
3317
--
3318
-- Table structure for table 'plugin_data'
3318
-- Table structure for table 'plugin_data'
Lines 3323-3329 CREATE TABLE IF NOT EXISTS plugin_data ( Link Here
3323
  plugin_key varchar(255) NOT NULL,
3323
  plugin_key varchar(255) NOT NULL,
3324
  plugin_value text,
3324
  plugin_value text,
3325
  PRIMARY KEY (plugin_class,plugin_key)
3325
  PRIMARY KEY (plugin_class,plugin_key)
3326
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3326
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3327
3327
3328
--
3328
--
3329
-- Table structure for table `patron_lists`
3329
-- Table structure for table `patron_lists`
Lines 3336-3342 CREATE TABLE patron_lists ( Link Here
3336
  owner int(11) NOT NULL,                         -- borrowernumber of the list creator
3336
  owner int(11) NOT NULL,                         -- borrowernumber of the list creator
3337
  PRIMARY KEY (patron_list_id),
3337
  PRIMARY KEY (patron_list_id),
3338
  KEY owner (owner)
3338
  KEY owner (owner)
3339
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3339
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3340
3340
3341
--
3341
--
3342
-- Constraints for table `patron_lists`
3342
-- Constraints for table `patron_lists`
Lines 3356-3362 CREATE TABLE patron_list_patrons ( Link Here
3356
  PRIMARY KEY (patron_list_patron_id),
3356
  PRIMARY KEY (patron_list_patron_id),
3357
  KEY patron_list_id (patron_list_id),
3357
  KEY patron_list_id (patron_list_id),
3358
  KEY borrowernumber (borrowernumber)
3358
  KEY borrowernumber (borrowernumber)
3359
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3359
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3360
3360
3361
--
3361
--
3362
-- Constraints for table `patron_list_patrons`
3362
-- Constraints for table `patron_list_patrons`
Lines 3373-3379 CREATE TABLE IF NOT EXISTS marc_modification_templates ( Link Here
3373
    template_id int(11) NOT NULL AUTO_INCREMENT,
3373
    template_id int(11) NOT NULL AUTO_INCREMENT,
3374
    name text NOT NULL,
3374
    name text NOT NULL,
3375
    PRIMARY KEY (template_id)
3375
    PRIMARY KEY (template_id)
3376
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3376
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3377
3377
3378
--
3378
--
3379
-- Table structure for table 'marc_modification_template_actions'
3379
-- Table structure for table 'marc_modification_template_actions'
Lines 3402-3408 CREATE TABLE IF NOT EXISTS marc_modification_template_actions ( Link Here
3402
  description text,
3402
  description text,
3403
  PRIMARY KEY (mmta_id),
3403
  PRIMARY KEY (mmta_id),
3404
  CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE
3404
  CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE
3405
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3405
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3406
3406
3407
--
3407
--
3408
-- Table structure for table `misc_files`
3408
-- Table structure for table `misc_files`
Lines 3420-3426 CREATE TABLE IF NOT EXISTS `misc_files` ( -- miscellaneous files attached to rec Link Here
3420
  PRIMARY KEY (`file_id`),
3420
  PRIMARY KEY (`file_id`),
3421
  KEY `table_tag` (`table_tag`),
3421
  KEY `table_tag` (`table_tag`),
3422
  KEY `record_id` (`record_id`)
3422
  KEY `record_id` (`record_id`)
3423
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3423
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3424
3424
3425
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3425
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3426
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3426
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +13 lines)
Lines 8577-8582 if ( CheckVersion($DBversion) ) { Link Here
8577
    SetVersion ($DBversion);
8577
    SetVersion ($DBversion);
8578
}
8578
}
8579
8579
8580
$DBversion = "3.17.00.XXX";
8581
if ( CheckVersion($DBversion) ) {
8582
    $dbh->do(q|SET foreign_key_checks = 0|);;
8583
    my @tables = $dbh->tables();
8584
    for my $table ( @tables ) {
8585
        $dbh->do(qq|ALTER TABLE $table CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci|);
8586
    }
8587
    $dbh->do(q|SET foreign_key_checks = 1|);;
8588
8589
    print "Upgrade to $DBversion done (Bug 11944 - Convert DB tables to utf8_unicode_ci)\n";
8590
    SetVersion ($DBversion);
8591
}
8592
8580
=head1 FUNCTIONS
8593
=head1 FUNCTIONS
8581
8594
8582
=head2 TableExists($table)
8595
=head2 TableExists($table)
8583
- 

Return to bug 11944