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

(-)a/installer/data/mysql/atomicupdate/bug_13534.sql (+6 lines)
Line 0 Link Here
1
ALTER TABLE tags_all MODIFY COLUMN borrowernumber INT(11);
2
ALTER TABLE tags_all drop FOREIGN KEY tags_borrowers_fk_1;
3
ALTER TABLE tags_all ADD CONSTRAINT `tags_borrowers_fk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE;
4
5
ALTER TABLE tags_approval DROP FOREIGN KEY tags_approval_borrowers_fk_1;
6
ALTER TABLE tags_approval ADD CONSTRAINT `tags_approval_borrowers_fk_1` FOREIGN KEY (`approved_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE;
(-)a/installer/data/mysql/kohastructure.sql (-4 / +3 lines)
Lines 2239-2245 CREATE TABLE `tags` ( Link Here
2239
DROP TABLE IF EXISTS `tags_all`;
2239
DROP TABLE IF EXISTS `tags_all`;
2240
CREATE TABLE `tags_all` ( -- all of the tags
2240
CREATE TABLE `tags_all` ( -- all of the tags
2241
  `tag_id`         int(11) NOT NULL auto_increment, -- unique id and primary key
2241
  `tag_id`         int(11) NOT NULL auto_increment, -- unique id and primary key
2242
  `borrowernumber` int(11) NOT NULL, -- the patron who added the tag (borrowers.borrowernumber)
2242
  `borrowernumber` int(11) DEFAULT NULL, -- the patron who added the tag (borrowers.borrowernumber)
2243
  `biblionumber`   int(11) NOT NULL, -- the bib record this tag was left on (biblio.biblionumber)
2243
  `biblionumber`   int(11) NOT NULL, -- the bib record this tag was left on (biblio.biblionumber)
2244
  `term`      varchar(255) NOT NULL, -- the tag
2244
  `term`      varchar(255) NOT NULL, -- the tag
2245
  `language`       int(4) default NULL, -- the language the tag was left in
2245
  `language`       int(4) default NULL, -- the language the tag was left in
Lines 2248-2254 CREATE TABLE `tags_all` ( -- all of the tags Link Here
2248
  KEY `tags_borrowers_fk_1` (`borrowernumber`),
2248
  KEY `tags_borrowers_fk_1` (`borrowernumber`),
2249
  KEY `tags_biblionumber_fk_1` (`biblionumber`),
2249
  KEY `tags_biblionumber_fk_1` (`biblionumber`),
2250
  CONSTRAINT `tags_borrowers_fk_1` FOREIGN KEY (`borrowernumber`)
2250
  CONSTRAINT `tags_borrowers_fk_1` FOREIGN KEY (`borrowernumber`)
2251
        REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2251
        REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
2252
  CONSTRAINT `tags_biblionumber_fk_1` FOREIGN KEY (`biblionumber`)
2252
  CONSTRAINT `tags_biblionumber_fk_1` FOREIGN KEY (`biblionumber`)
2253
        REFERENCES `biblio`     (`biblionumber`)  ON DELETE CASCADE ON UPDATE CASCADE
2253
        REFERENCES `biblio`     (`biblionumber`)  ON DELETE CASCADE ON UPDATE CASCADE
2254
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2254
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Lines 2267-2273 CREATE TABLE `tags_approval` ( -- approved tags Link Here
2267
  PRIMARY KEY  (`term`),
2267
  PRIMARY KEY  (`term`),
2268
  KEY `tags_approval_borrowers_fk_1` (`approved_by`),
2268
  KEY `tags_approval_borrowers_fk_1` (`approved_by`),
2269
  CONSTRAINT `tags_approval_borrowers_fk_1` FOREIGN KEY (`approved_by`)
2269
  CONSTRAINT `tags_approval_borrowers_fk_1` FOREIGN KEY (`approved_by`)
2270
        REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
2270
        REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
2271
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2271
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2272
2272
2273
--
2273
--
2274
- 

Return to bug 13534