Moti Asayag has uploaded a new change for review.

Change subject: engine: Modify vm_interface-vnic-profiles foreign key
......................................................................

engine: Modify vm_interface-vnic-profiles foreign key

The patch modifies the FK of vm_interface on vnic-profiles
to be set NULL in case of deletion of the vnic profiles.

Removal of a vnic profile which is used by vnics is blocked
by can-do-action, same for network removal which is used by
vms.

However, when forcibly removing a data-center, the removal of
the vm interface is being executed in a different transaction
than the network entities.

This can be avoided if the logic of DC removal would have been
implemented by code and not in a stored procedure.

Change-Id: I2feef15a7460899979a78b357886bd1f027918af
Bug-Url: https://bugzilla.redhat.com/996934
Signed-off-by: Moti Asayag <[email protected]>
---
A packaging/dbscripts/upgrade/03_03_0770_alter_vm_interface_vnic_profile_fk.sql
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/75/18175/1

diff --git 
a/packaging/dbscripts/upgrade/03_03_0770_alter_vm_interface_vnic_profile_fk.sql 
b/packaging/dbscripts/upgrade/03_03_0770_alter_vm_interface_vnic_profile_fk.sql
new file mode 100644
index 0000000..2ea7633
--- /dev/null
+++ 
b/packaging/dbscripts/upgrade/03_03_0770_alter_vm_interface_vnic_profile_fk.sql
@@ -0,0 +1,3 @@
+ALTER TABLE vm_interface DROP CONSTRAINT fk_vm_interface_vnic_profile_id;
+ALTER TABLE vm_interface ADD CONSTRAINT fk_vm_interface_vnic_profile_id 
FOREIGN KEY (vnic_profile_id) REFERENCES vnic_profiles(id) ON DELETE SET NULL;
+


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

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

Reply via email to