DO $$
DECLARE
 version_new_ CONSTANT integer := 23;-- new version number --
 ver_ integer;
BEGIN
  LOCK TABLE variables;
  SELECT version_is('Ls') INTO ver_;
  IF ver_ < version_new_ THEN
    -- begin update --

INSERT INTO object_settings_type(_otype, key, name, descr, type, min_value, max_value)
                         VALUES (2, 'Gain', 'Gain value', 'Gain value in percents (if possible)', 'int', '0', '100');
INSERT INTO object_settings_type(_otype, key, name, descr, type, min_value, max_value)
                         VALUES (2, 'Amplify', 'Amplify value', 'Amplify value in percents (if possible)', 'int', '-1', '100');
PERFORM objects_add_setting(2, 'Gain', '1');
PERFORM objects_add_setting(2, 'Amplify', '-1');

    -- end update --
    PERFORM version_set('Ls', version_new_);
  END IF;
END$$;