http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13515 Bug ID: 13515 Summary: Table messages is missing FK constraints and is never cleaned up Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Database Assignee: gmcharlt@gmail.com Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org The table messages is used to store notes to the patron (visible in OPAC) and internal notes for circulation. There is no FK on the borrowernumber, so the data in this table is never cleaned up, not even on deleting the patron. There is also no FK on the branchcode, although the comments state otherwise. 2723 -- Table structure for table `messages` 2724 -- 2725 DROP TABLE IF EXISTS `messages`; 2726 CREATE TABLE `messages` ( -- circulation messages left via the patron's check out screen 2727 `message_id` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha 2728 `borrowernumber` int(11) NOT NULL, -- foreign key linking this message to the borrowers table 2729 `branchcode` varchar(10) default NULL, -- foreign key linking the message to the branches table 2730 `message_type` varchar(1) NOT NULL, -- whether the message is for the librarians (L) or the patron (B) 2731 `message` text NOT NULL, -- the text of the message 2732 `message_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- the date and time the message was written 2733 PRIMARY KEY (`message_id`) 2734 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- You are receiving this mail because: You are watching all bug changes.