|
The only solution is to merge again from the source models and overwrite the new details and expressions. |
|
|
Query the server repository over all versions and models to find the newest mismatches:
select
org.item_name, max(org.ig_version) as ig_version, org.otft_name, org.exp_code, org.expparts as origin_expparts, other.item_name as used_in, max(other.ig_version) as used_in_ig_version, other.expparts as used_expparts ,
case when len(org.expparts) < len(other.expparts)
then 'Not truncated'
else 'Missing parts'
end as status
from
(
select iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version, STRING_AGG(exp_part_no,',') expparts
from ctk_expression_part ep
join ctk_expression e on e.ig_version = ep.ig_version and e.exp_code = ep.exp_code
join ctk_item_version iv on iv.item_version = e.ig_version
join ctk_information_model i on i.ig_version = ep.ig_version and derived_from_ig_version is null
group by iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version
) org
join
(
select iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version, STRING_AGG(exp_part_no,',') expparts
from ctk_expression_part ep
join ctk_expression e on e.ig_version = ep.ig_version and e.exp_code = ep.exp_code
join ctk_item_version iv on iv.item_version = e.ig_version
join ctk_information_model i on i.ig_version = ep.ig_version and derived_from_ig_version is null
group by iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version
) other
on other.exp_synclink = org.exp_synclink
and other.otft_name = org.otft_name
and other.ig_version > org.ig_version
and other.namespace_version = org.ig_version
and other.expparts <> org.expparts
and org.item_name <> other.item_name
group by
org.item_name, org.otft_name, org.exp_code, org.expparts, other.item_name, other.expparts
|
|
|
Or just a list of relevant OTFTs which are affected by the bug:
select distinct
org.item_name, -- max(org.ig_version) as ig_version,
org.otft_name,
-- org.exp_code, org.expparts as origin_expparts,
other.item_name as used_in, -- max(other.ig_version) as used_in_ig_version,
-- other.expparts as used_expparts ,
case when len(org.expparts) < len(other.expparts)
then 'Not truncated'
else 'Missing parts'
end as status
from
(
select iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version, STRING_AGG(exp_part_no,',') expparts
from ctk_expression_part ep
join ctk_expression e on e.ig_version = ep.ig_version and e.exp_code = ep.exp_code
join ctk_item_version iv on iv.item_version = e.ig_version
join ctk_information_model i on i.ig_version = ep.ig_version and derived_from_ig_version is null
group by iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version
) org
join
(
select iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version, STRING_AGG(exp_part_no,',') expparts
from ctk_expression_part ep
join ctk_expression e on e.ig_version = ep.ig_version and e.exp_code = ep.exp_code
join ctk_item_version iv on iv.item_version = e.ig_version
join ctk_information_model i on i.ig_version = ep.ig_version and derived_from_ig_version is null
group by iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version
) other
on other.exp_synclink = org.exp_synclink
and other.otft_name = org.otft_name
and other.ig_version > org.ig_version
and other.namespace_version = org.ig_version
and other.expparts <> org.expparts
and org.item_name <> other.item_name
group by
org.item_name, org.otft_name, org.exp_code, org.expparts, other.item_name, other.expparts
order by item_name, otft_name, used_in, status
|
|
|
The mismatch of amount of expression parts during merge has been fixed. The problem should resolve itself once source models are merged again with 'Overwrite Details' turned on. |
|
|
Only model combinations which need re-merging:
select distinct
org.item_name, -- max(org.ig_version) as ig_version,
-- org.otft_name,
-- org.exp_code, org.expparts as origin_expparts,
other.item_name as used_in -- max(other.ig_version) as used_in_ig_version,
-- other.expparts as used_expparts ,
/*
case when len(org.expparts) < len(other.expparts)
then 'Not truncated'
else 'Missing parts'
end as status
*/
from
(
select iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version, STRING_AGG(exp_part_no,',') expparts
from ctk_expression_part ep
join ctk_expression e on e.ig_version = ep.ig_version and e.exp_code = ep.exp_code
join ctk_item_version iv on iv.item_version = e.ig_version
join ctk_information_model i on i.ig_version = ep.ig_version and derived_from_ig_version is null
group by iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version
) org
join
(
select iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version, STRING_AGG(exp_part_no,',') expparts
from ctk_expression_part ep
join ctk_expression e on e.ig_version = ep.ig_version and e.exp_code = ep.exp_code
join ctk_item_version iv on iv.item_version = e.ig_version
join ctk_information_model i on i.ig_version = ep.ig_version and derived_from_ig_version is null
group by iv.item_name, ep.ig_version, e.otft_name, ep.exp_code, e.exp_synclink, e.namespace_version
) other
on other.exp_synclink = org.exp_synclink
and other.otft_name = org.otft_name
and other.ig_version > org.ig_version
and other.namespace_version = org.ig_version
and other.expparts <> org.expparts
and org.item_name <> other.item_name
group by
org.item_name, -- org.otft_name, org.exp_code, org.expparts,
other.item_name -- , other.expparts
order by item_name, -- otft_name,
used_in --, status
|
|