Commit 21510d23 authored by Frank Bergmann's avatar Frank Bergmann

- fixed upgrade issue

parent ab7ce8ff
......@@ -6,23 +6,29 @@
--
-- This should eventually be added to the acs-service-contract installation files
create or replace function inline_0 ()
returns integer as $body$
DECLARE
v_count integer;
BEGIN
select count(*) into v_count from acs_sc_contracts
where contract_name = 'AcsObject';
IF v_count > 0 THEN return 1; END IF;
begin;
select acs_sc_contract__new(
select acs_sc_contract__new(
'AcsObject', -- contract_name
'Acs Object Id Handler' -- contract_desc
);
select acs_sc_msg_type__new(
);
select acs_sc_msg_type__new(
'AcsObject.PageUrl.InputType', -- msg_type_name
'object_id:integer' -- msg_type_spec
);
select acs_sc_msg_type__new(
);
select acs_sc_msg_type__new(
'AcsObject.PageUrl.OutputType', -- msg_type_name
'page_url:string' -- msg_type_spec
);
select acs_sc_operation__new(
);
select acs_sc_operation__new(
'AcsObject', -- contract_name
'PageUrl', -- operation_name
'Returns the package specific url to a page that displays an object', -- operation_desc
......@@ -30,8 +36,14 @@ begin;
1, -- operation_nargs
'AcsObject.PageUrl.InputType', -- operation_inputtype
'AcsObject.PageUrl.OutputType' -- operation_outputtype
);
end;
);
return 0;
end;$body$ language 'plpgsql';
select inline_0();
drop function inline_0();
-- there should be an implementation of this contract
-- for apm_package, user, group and other object types
......@@ -56,19 +68,19 @@ create index acs_named_objs_package_ix on acs_named_objects(package_id);
create function inline_0 ()
returns integer as '
begin
PERFORM acs_object_type__create_type (
''acs_named_object'', -- object_type
''Named Object'', -- pretty_name
''Named Objects'', -- pretty_plural
''acs_object'', -- supertype
''acs_named_objects'', -- table_name
''object_id'', -- id_column
null, -- name_method
''f'',
null,
null
);
return 0;
PERFORM acs_object_type__create_type (
''acs_named_object'', -- object_type
''Named Object'', -- pretty_name
''Named Objects'', -- pretty_plural
''acs_object'', -- supertype
''acs_named_objects'', -- table_name
''object_id'', -- id_column
null, -- name_method
''f'',
null,
null
);
return 0;
end;' language 'plpgsql';
select inline_0 ();
drop function inline_0 ();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment