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

--- Spodes router --- (11, 11)
INSERT INTO object_type (_id, name, descr) VALUES (11, 'ssr', 'Spodes router');
INSERT INTO object(_id, _otype, guid, name, descr, revision, uri, status) VALUES (11, 11, 'ssr', 'Spodes router server', 'Spodes router server default', 0, '', 0);
INSERT INTO object_connection(_omaster, _oslave, type) VALUES (0, 11, 0);

--- Spodes router --- (11, 11)
INSERT INTO object_settings_type(_otype, key, name, descr, type, min_value, max_value)
  VALUES (11, 'Port', 'Port', 'Router port', 'int', '1024', '65535');
INSERT INTO object_settings(_object, key, value) VALUES (11, 'Port', '19000');

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