Eli Mesika has uploaded a new change for review.

Change subject: core:  db fix event renaming upgrade script.
......................................................................

core:  db fix event renaming upgrade script.

db upgrade fails if there's a subscription to VDS_HIGH_NETWORK_USE event

Original upgrade script renamed an event without taking in account that
it may be used by subscribers.
This patch updates both event_map and event_sunscriber tables with the
renamed event, in order to do that we need to remove the FK before the
update and adding it back again after the update is finished.

Change-Id: I3ac7f33fad30aba5cc459ec05dc990a60bbc65e0
Signed-off-by: Eli Mesika <[email protected]>
---
M 
packaging/dbscripts/upgrade/03_05_0160_add_host_interface_high_network_use_event.sql
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/87/27287/1

diff --git 
a/packaging/dbscripts/upgrade/03_05_0160_add_host_interface_high_network_use_event.sql
 
b/packaging/dbscripts/upgrade/03_05_0160_add_host_interface_high_network_use_event.sql
index 9f05eca..de0d66c 100644
--- 
a/packaging/dbscripts/upgrade/03_05_0160_add_host_interface_high_network_use_event.sql
+++ 
b/packaging/dbscripts/upgrade/03_05_0160_add_host_interface_high_network_use_event.sql
@@ -1 +1,4 @@
+ALTER TABLE event_subscriber DROP CONSTRAINT fk_event_subscriber_event_map;
+update event_subscriber set event_up_name = 'HOST_INTERFACE_HIGH_NETWORK_USE' 
where event_up_name='VDS_HIGH_NETWORK_USE';
 update event_map set event_up_name = 'HOST_INTERFACE_HIGH_NETWORK_USE' where 
event_up_name='VDS_HIGH_NETWORK_USE';
+ALTER TABLE event_subscriber ADD CONSTRAINT fk_event_subscriber_event_map 
FOREIGN KEY (event_up_name) REFERENCES event_map(event_up_name) ON DELETE 
CASCADE;


-- 
To view, visit http://gerrit.ovirt.org/27287
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ac7f33fad30aba5cc459ec05dc990a60bbc65e0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to