
Gilad Chaplik has submitted this change and it was merged. Change subject: core: add foreign key to quota_id ...................................................................... core: add foreign key to quota_id problem: quota_id field (in vm_static and images) isn't linked to quota table, therefore when removing a quota, it doesn't clear the quota_id ref. solution: set quota_id fields as foreign keys and use set NULL on delete. Currently there is extensive usage of Guid.Empty to indicate null, removed that in relevant DAOs. Upgrade: - set NULL instead of Guid.Empty - set NULL instead of non-existing quota ids - add the foreign key constraint Change-Id: I5092a3070937719009fa1fb4fb9ecb792f03b969 Bug-Url: https://bugzilla.redhat.com/1003839 Signed-off-by: Gilad Chaplik <gchaplik@redhat.com> --- M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/ImageDaoDbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java A packaging/dbscripts/upgrade/03_03_0900_quota_id_foreign_key.sql 6 files changed, 16 insertions(+), 5 deletions(-) Approvals: Gilad Chaplik: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/19446 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5092a3070937719009fa1fb4fb9ecb792f03b969 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <gchaplik@redhat.com> Gerrit-Reviewer: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfediuck@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchaplik@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server