Change in ovirt-engine[ovirt-engine-3.3]: core: add foreign key to quota_id

iheim at redhat.com iheim at redhat.com
Mon Sep 30 11:13:04 UTC 2013


Itamar Heim 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 at 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:
  Itamar Heim: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5092a3070937719009fa1fb4fb9ecb792f03b969
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Gilad Chaplik <gchaplik at redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfediuck at redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik at redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim at redhat.com>
Gerrit-Reviewer: automation at ovirt.org



More information about the Engine-commits mailing list