You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
db-schema/db_scripts/diff/15057.up

32 lines
1.2 KiB

USE billing;
CREATE TABLE `email_templates` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`reseller_id` int(11) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`from_email` varchar(255) NOT NULL,
`subject` varchar(255) NOT NULL,
`body` mediumtext NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `reseller_name_idx` (`reseller_id`,`name`),
CONSTRAINT `fk_email_reseller` FOREIGN KEY (`reseller_id`) REFERENCES `resellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB;
CREATE TABLE `password_resets` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`subscriber_id` int(11) unsigned NOT NULL,
`uuid` char(36) NOT NULL,
`timestamp` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `uuid_idx` (`uuid`),
KEY `fk_pwd_reset_sub` (`subscriber_id`),
CONSTRAINT `fk_pwd_reset_sub` FOREIGN KEY (`subscriber_id`) REFERENCES `voip_subscribers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB;
ALTER TABLE contracts
ADD COLUMN subscriber_email_template_id INT(11) UNSIGNED DEFAULT NULL,
ADD COLUMN passreset_email_template_id INT(11) UNSIGNED DEFAULT NULL;
ALTER TABLE voip_subscribers
ADD COLUMN `contact_id` int(11) unsigned DEFAULT NULL;