CREATE
	OR REPLACE VIEW VW_FSI_DE_MIGRATION_UNION_DE AS

SELECT FSI_DS_SEEDED_VW_INFO.JURISDICTION_CD JURISDICTION_CODE
	,FSI_DS_SEEDED_VW_INFO.VIEW_NAME UNION_DE_CODE
	,PARENT_METADATA.COLUMN_NAME UNION_METADATA
	,FSI_DS_INT_CHILD_INFO.DE_CD CHILD_DE_CODE
	,CHILD_METADATA.COLUMN_NAME CHILD_METADATA
FROM FSI_DS_CHILD_COL_MAP
INNER JOIN FSI_DS_VW_COL_INFO CHILD_METADATA ON FSI_DS_CHILD_COL_MAP.COL_ID = CHILD_METADATA.COL_ID
INNER JOIN FSI_DS_VW_COL_INFO PARENT_METADATA ON FSI_DS_CHILD_COL_MAP.PARENT_COL_ID = PARENT_METADATA.COL_ID
INNER JOIN FSI_DS_SEEDED_VW_INFO ON FSI_DS_SEEDED_VW_INFO.VIEW_ID = FSI_DS_CHILD_COL_MAP.PARENT_ID
INNER JOIN FSI_DS_INT_CHILD_INFO ON FSI_DS_INT_CHILD_INFO.DS_ID = FSI_DS_CHILD_COL_MAP.DS_ID
	AND FSI_DS_INT_CHILD_INFO.IS_EDITABLE = 'Y'
