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/15076.up

16 lines
866 B

USE provisioning;
-- needed for new cloud_pbx_account_cli_list pref query
GRANT SELECT ON provisioning.voip_dbaliases to kamailio@localhost;
-- populate new cloud_pbx_ext preference for existing subscribers
select id into @vpid from voip_preferences where attribute = 'cloud_pbx_ext';
insert into voip_usr_preferences
(modify_timestamp, attribute_id, subscriber_id, value)
(select now(), @vpid, id, pbx_extension
from voip_subscribers where pbx_extension is not null);
-- migrate pbx_group_id over to new voip_pbx_groups mapping table
insert into voip_pbx_groups (subscriber_id, group_id) (select pvs.id, pvg.id from voip_subscribers pvs left join billing.voip_subscribers bvs on bvs.id = pvs.pbx_group_id left join voip_subscribers pvg on bvs.uuid = pvg.uuid where pvs.pbx_group_id is not null);
alter table voip_subscribers drop column pbx_group_id;