----- Original Message ----- > From: "Eli Mesika" <emes...@redhat.com> > To: "engine-de...@ovirt.org" <devel@ovirt.org> > Sent: Monday, November 17, 2014 12:42:29 PM > Subject: Re: [ovirt-devel] [db] add config key with same value to multiple > versions > > > > ----- Original Message ----- > > From: "Eli Mesika" <emes...@redhat.com> > > To: "engine-de...@ovirt.org" <devel@ovirt.org> > > Sent: Monday, November 17, 2014 12:40:53 PM > > Subject: [ovirt-devel] [db] add config key with same value to multiple > > versions > > > > Hi > > > > Please note that I have added a common function to ease handling of > > configuration settings: > > > > signature : fn_db_add_config_value_for_versions_up_to(v_option_name, v_val > > , > > v_version ) > > > > so, for example, if you want to add a new feature F1 flag, which is true > > only > > for 3.6, to 0000_config.sql instead of : > > > > select fn_db_add_config_value('F1','false','3.0'); > > select fn_db_add_config_value('F1','false','3.1'); > > select fn_db_add_config_value('F1','false','3.2'); > > select fn_db_add_config_value('F1','false','3.3'); > > select fn_db_add_config_value('F1','false', '3.4'); > > select fn_db_add_config_value('F1','true', '3.5'); > sorry, this one is > select fn_db_add_config_value('F1','false', '3.5'); > > > > > All you have to do is : > > > > fn_db_add_config_value_for_versions_up_to('F1','true', '3.5');
fn_db_add_config_value_for_versions_up_to('F1','false', '3.5'); > > > > This is true also for other values, for example if you have a key K1 that > > has > > values 'a' for {3.0, 3.1} and 'b' for {3.2, 3.3, 3.4, 3.5) > > > > instead of > > > > select fn_db_add_config_value('K1','a','3.0'); > > select fn_db_add_config_value('K1','a','3.1'); > > select fn_db_add_config_value('K1','b','3.2'); > > select fn_db_add_config_value('K1','b','3.3'); > > select fn_db_add_config_value('K1','b', '3.4'); > > select fn_db_add_config_value('K1','b', '3.5'); > > > > simply write : > > > > fn_db_add_config_value_for_versions_up_to('K1','a', '3.1'); > > fn_db_add_config_value_for_versions_up_to('K1','b', '3.5'); > > > > > > > > Thanks > > Eli Mesika > > > > _______________________________________________ > > Devel mailing list > > Devel@ovirt.org > > http://lists.ovirt.org/mailman/listinfo/devel > > > _______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel