select case when item_id is null then 0 else item_id end as item_id
from apm_package_versions
where version_id = :version_id
update apm_package_versions
set item_id = :item_id
where version_id = :version_id
select live_revision as revision_id
from cr_items
where item_id = :item_id
select db_type_key from apm_package_db_types
select package_key from apm_package_version_info where version_id = :version_id