`imageurl` varchar(200) default NULL,
PRIMARY KEY (`id`),
KEY `name` (`category`),
- KEY `lib` (`lib`)
+ KEY `lib` (`lib`),
+ KEY `auth_value_idx` (`authorised_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
KEY `categorycode` (`categorycode`),
KEY `branchcode` (`branchcode`),
KEY `userid` (`userid`),
+ KEY `guarantorid` (`guarantorid`),
CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`),
CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
`password_allowed` tinyint(1) NOT NULL default 0,
`staff_searchable` tinyint(1) NOT NULL default 0,
`authorised_value_category` varchar(10) default NULL,
- PRIMARY KEY (`code`)
+ PRIMARY KEY (`code`),
+ KEY `auth_val_cat_idx` (`authorised_value_category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
DROP TABLE IF EXISTS `subscriptionroutinglist`;
CREATE TABLE `subscriptionroutinglist` (
`routingid` int(11) NOT NULL auto_increment,
- `borrowernumber` int(11) default NULL,
+ `borrowernumber` int(11) NOT NULL,
`ranking` int(11) default NULL,
- `subscriptionid` int(11) default NULL,
- PRIMARY KEY (`routingid`)
+ `subscriptionid` int(11) NOT NULL,
+ PRIMARY KEY (`routingid`),
+ UNIQUE (`subscriptionid`, `borrowernumber`),
+ CONSTRAINT `subscriptionroutinglist_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
+ ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `subscriptionroutinglist_ibfk_2` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`)
+ ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
DROP TABLE IF EXISTS `message_attributes`;
CREATE TABLE `message_attributes` (
`message_attribute_id` int(11) NOT NULL auto_increment,
- `message_name` varchar(20) NOT NULL default '',
+ `message_name` varchar(40) NOT NULL default '',
`takes_days` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`message_attribute_id`),
UNIQUE KEY `message_name` (`message_name`)