Omer Frenkel has uploaded a new change for review.

Change subject: core: update blank template origin type
......................................................................

core: update blank template origin type

currently the origin type for blank template is always RHEV
there is a config in the db for the default origin type of vms
so this patch uses this config to update blank template to the current
configuration, should be OVIRT in most cases.

Change-Id: Ib844899a61093c1c2b70a34adcddb0b9bca83b37
Signed-off-by: Omer Frenkel <ofren...@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1057211
---
A packaging/dbscripts/upgrade/03_06_0020_update_blank_template_origin_type.sql
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/11/30111/1

diff --git 
a/packaging/dbscripts/upgrade/03_06_0020_update_blank_template_origin_type.sql 
b/packaging/dbscripts/upgrade/03_06_0020_update_blank_template_origin_type.sql
new file mode 100644
index 0000000..9ac7ec4
--- /dev/null
+++ 
b/packaging/dbscripts/upgrade/03_06_0020_update_blank_template_origin_type.sql
@@ -0,0 +1,11 @@
+-- update blank template origin to the origin in the config table
+-- there is also covertion from the enum name that is saved in the config
+-- to the value that is saved in vm_static ('RHEV'->0 otherwise use 'OVIRT'->3)
+update vm_static set
+origin=
+    case
+        when exists (select * from vdc_options where option_name = 
'OriginType' and option_value = 'RHEV')
+        then 0
+        else 3
+    end
+where vm_guid='00000000-0000-0000-0000-000000000000';


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib844899a61093c1c2b70a34adcddb0b9bca83b37
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Omer Frenkel <ofren...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to