MT#12507 Fix 15139.up: remove hardcoded reference to voip_preference_groups

Otherwise 2.8-mr3.8 upgrade failed with error:
> Applying revision script /usr/share/ngcp-db-schema/db_scripts/diff/15139.up:
> ERROR 1452 (23000) at line 4: Cannot add or update a child row: a foreign key constraint fails
> (`provisioning`.`voip_preferences`, CONSTRAINT `vpgid_ref` FOREIGN KEY
> (`voip_preference_groups_id`) REFERENCES `voip_preference_groups` (`id`) ON UPDATE CASCADE)

It happens because statements are executed on sp1/sp2 (even/odd id's):
> mysql> select * from voip_preference_groups;
> +----+----------------------------+
> | id | name                       |
> +----+----------------------------+
> |  2 | Call Forwards              |
> |  4 | Call Blockings             |
> |  6 | Access Restrictions        |
> |  8 | Number Manipulations       |
> | 10 | NAT and Media Flow Control |
> | 12 | Remote Authentication      |
> | 14 | Session Timers             |
> | 16 | Internals                  |
> | 18 | Cloud PBX                  |
> | 20 | XMPP Settings              |
> +----+----------------------------+
> 10 rows in set (0.00 sec)

Change-Id: I90782a5dae5017f22c240ced15661b88594cff69
changes/88/1688/2
Alexander Lutay 11 years ago
parent 78d4fa966a
commit 178736df06

@ -1,7 +1,8 @@
use provisioning;
set autocommit=0;
insert into voip_preferences values (null, 5, 'rtp_interface', 'RTP interface', 0, 1, 1, 0, 1, 1, 0, now(), 0, 0, 'enum', 0, 'Logical RTP interface to use for media packets');
select id into @vpg_id from voip_preference_groups where name="NAT and Media Flow Control";
insert into voip_preferences values (null, @vpg_id, 'rtp_interface', 'RTP interface', 0, 1, 1, 0, 1, 1, 0, now(), 0, 0, 'enum', 0, 'Logical RTP interface to use for media packets');
select last_insert_id() into @ins_id;
insert into voip_preferences_enum values (null, @ins_id, 'default', null, 1, 1, 1, 1, null, 1);

Loading…
Cancel
Save