mirror of https://github.com/sipwise/db-schema.git
parent
37466371a4
commit
61c38c9998
@ -0,0 +1,7 @@
|
||||
USE provisioning;
|
||||
|
||||
ALTER TABLE voip_subscribers
|
||||
DROP COLUMN profile_id;
|
||||
|
||||
DROP TABLE voip_subscriber_profile_attributes;
|
||||
DROP TABLE voip_subscriber_profiles;
|
@ -0,0 +1,24 @@
|
||||
USE provisioning;
|
||||
|
||||
CREATE TABLE `voip_subscriber_profiles` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`reseller_id` int(11) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`description` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `vsp_resname_idx` (`reseller_id`,`name`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE `voip_subscriber_profile_attributes` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`profile_id` int(11) unsigned NOT NULL,
|
||||
`attribute_id` int(11) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `prof_attr_idx` (`profile_id`,`attribute_id`),
|
||||
KEY `attribute_id` (`attribute_id`),
|
||||
KEY `profile_idx` (`profile_id`),
|
||||
CONSTRAINT `voip_subscriber_profile_attributes_ibfk_1` FOREIGN KEY (`attribute_id`) REFERENCES `voip_preferences` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
ALTER TABLE voip_subscribers
|
||||
ADD COLUMN profile_id INT(11) UNSIGNED DEFAULT NULL AFTER pbx_group_id;
|
Loading…
Reference in new issue