mirror of https://github.com/sipwise/db-schema.git
Try to fix the lcr_rule key issue #1967
The ley that is tried to be created in 9868.up has no group_id field so it won't be applied in case you already have two peering groups with same peering rules. In case you don't it will apply but the resulting 2.6 version won't allow you to have different peering groups with same peering rules. The solution is what follows: We edit the existing db scripts to allow upgrades to work well. This will make existing 2.6 systems and new 2.6 systems to have different db scehmas. And the existing ones will be still broken. A new db rev 10860.up has been created to unify both kind of systems (the ones which executed the original revs and the ones which excuted the edited ones) and it will also fix the existing versions as it will be executed in existing 2.6 systems via postinst script. Why postinst script? We can't trust users to execute update-db-schema as we don't know all of them. It's better to handle this automatically. This postinst addition is being handled by Mika in another commit.2.6
parent
f6d2531172
commit
cd76e18027
@ -1,6 +1,6 @@
|
||||
use kamailio;
|
||||
|
||||
ALTER TABLE lcr_rule DROP KEY `lcr_id_prefix_from_uri_idx`;
|
||||
ALTER TABLE lcr_rule ADD UNIQUE KEY `lcr_id_prefix_from_uri_idx` (`lcr_id`,`prefix`,`from_uri`);
|
||||
#ALTER TABLE lcr_rule ADD UNIQUE KEY `lcr_id_prefix_from_uri_idx` (`lcr_id`,`prefix`,`from_uri`);
|
||||
|
||||
ALTER TABLE lcr_gw DROP `group_id`;
|
||||
|
@ -0,0 +1,5 @@
|
||||
use kamailio;
|
||||
|
||||
ALTER TABLE lcr_rule DROP KEY `lcr_id_prefix_from_uri_idx`;
|
||||
ALTER TABLE lcr_rule ADD UNIQUE KEY `lcr_id_prefix_from_uri_idx` (`lcr_id`,`prefix`,`from_uri`, `request_uri`, `group_id`);
|
||||
|
@ -0,0 +1,5 @@
|
||||
use kamailio;
|
||||
|
||||
ALTER TABLE lcr_rule DROP KEY `lcr_id_prefix_from_uri_idx`;
|
||||
ALTER TABLE lcr_rule ADD UNIQUE KEY `lcr_id_prefix_from_uri_idx` (`lcr_id`,`prefix`,`from_uri`, `request_uri`, `group_id`);
|
||||
|
Loading…
Reference in new issue