postgresql7.1
select version_name
from apm_package_versions
where package_key = :package_key
and version_id = apm_package__highest_version(:package_key)
select apm__register_parameter(
:parameter_id,
:package_key,
:parameter_name,
:description,
:scope,
:datatype,
:default_value,
:section_name,
:min_n_values,
:max_n_values
);
select apm__unregister_parameter(:parameter_id)
select apm_package_version__add_dependency(
:dependency_type,
:dependency_id,
:version_id,
:dependency_uri,
:dependency_version
);
select apm_package_version__remove_dependency(
:dependency_id
);
select apm_package_version__add_interface(
:interface_id,
:version_id,
:interface_uri,
:interface_version
);
select apm_package_version__remove_interface(
:interface_id
);
select apm_package__new(
:package_id,
:instance_name,
:package_key,
'apm_package',
now(),
null,
null,
:context_id
);
select apm_package__delete(:package_id);
select apm_parameter_value__new(null, :package_id, ap.parameter_id, ap.default_value)
from apm_parameters ap
where ap.package_key = :new_package_key
and not exists (select 1
from apm_parameters ap2
where ap2.package_key = :old_package_key
and ap2.parameter_name = ap.parameter_name)