Roy Golan has uploaded a new change for review. Change subject: core: func to delete all versions of a config val ......................................................................
core: func to delete all versions of a config val Adding a function to delete all versions of a config value so we don't have to specify which versions specifically to delete. Change-Id: I72c482d39b7c48dff5b6125cc1b795fbaabefa60 Signed-off-by: Roy Golan <[email protected]> --- M backend/manager/dbscripts/common_sp.sql 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/29/16029/1 diff --git a/backend/manager/dbscripts/common_sp.sql b/backend/manager/dbscripts/common_sp.sql index 91d99aa..d2374f4 100644 --- a/backend/manager/dbscripts/common_sp.sql +++ b/backend/manager/dbscripts/common_sp.sql @@ -86,6 +86,19 @@ END; $procedure$ LANGUAGE plpgsql; +-- Deletes a key from vdc_options if exists, for all its versions +create or replace FUNCTION fn_db_delete_config_value_all_versions(v_option_name varchar(100)) +returns void +AS $procedure$ +begin + if (exists (select 1 from vdc_options where option_name ilike v_option_name)) then + begin + delete from vdc_options where option_name ilike v_option_name; + end; + end if; +END; $procedure$ +LANGUAGE plpgsql; + -- Deletes a key from vdc_options (if exists) create or replace FUNCTION fn_db_delete_config_value(v_option_name varchar(100), v_version text) returns void -- To view, visit http://gerrit.ovirt.org/16029 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72c482d39b7c48dff5b6125cc1b795fbaabefa60 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Roy Golan <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
