Eli Mesika has uploaded a new change for review.

Change subject: db: skip column type change if already set
......................................................................

db: skip column type change if already set

This patch fix a failure in fn_db_change_column_type if the target type
was already applied manually on the column.
In this case the function will now succeed instead of failing and
causing the upgrade process to exit

Change-Id: Ifa88af621f21894d6d575a1e44f15a29d75b9c87
Signed-off-by: emesika <emes...@redhat.com>
---
M packaging/dbscripts/common_sp.sql
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/23/35823/1

diff --git a/packaging/dbscripts/common_sp.sql 
b/packaging/dbscripts/common_sp.sql
index 0d015ab..3aa5c52 100644
--- a/packaging/dbscripts/common_sp.sql
+++ b/packaging/dbscripts/common_sp.sql
@@ -51,7 +51,9 @@
                v_sql := 'ALTER TABLE ' || v_table || ' ALTER COLUMN ' || 
v_column || ' TYPE ' || v_new_type;
                EXECUTE v_sql;
             end;
-        else
+            --- ignore operation if requested type is already there
+        elsif (not exists (select 1 from information_schema.columns where 
table_name ilike v_table and column_name ilike v_column and
+                (udt_name ilike v_new_type or data_type ilike v_new_type))) 
then
             RAISE EXCEPTION 'Table % or Column % does not exist.', v_table, 
v_column;
        end if;
 END; $procedure$


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

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

Reply via email to