@@ -10,6 +10,7 @@ pub struct ImportOpExecutionContext {
1010
1111pub struct ExportOpExecutionContext {
1212 pub target_id : i32 ,
13+ pub schema_version_id : usize ,
1314}
1415
1516pub struct FlowSetupExecutionContext {
@@ -107,12 +108,12 @@ fn build_import_op_exec_ctx(
107108 Ok ( ImportOpExecutionContext { source_id } )
108109}
109110
110- fn build_target_id (
111+ fn build_export_op_exec_ctx (
111112 analyzed_target_ss : & AnalyzedTargetSetupState ,
112113 existing_target_states : & HashMap < & setup:: ResourceIdentifier , Vec < & setup:: TargetSetupState > > ,
113114 metadata : & mut setup:: FlowSetupMetadata ,
114115 target_states : & mut IndexMap < setup:: ResourceIdentifier , setup:: TargetSetupState > ,
115- ) -> Result < i32 > {
116+ ) -> Result < ExportOpExecutionContext > {
116117 let target_factory = get_target_factory ( & analyzed_target_ss. target_kind ) ?;
117118
118119 let resource_id = setup:: ResourceIdentifier {
@@ -121,7 +122,7 @@ fn build_target_id(
121122 } ;
122123 let existing_target_states = existing_target_states. get ( & resource_id) ;
123124 let mut compatible_target_ids = HashSet :: < Option < i32 > > :: new ( ) ;
124- let mut reusable_schema_version_ids = HashSet :: < Option < i32 > > :: new ( ) ;
125+ let mut reusable_schema_version_ids = HashSet :: < Option < usize > > :: new ( ) ;
125126 for existing_state in existing_target_states. iter ( ) . flat_map ( |v| v. iter ( ) ) {
126127 let compatibility = if let Some ( key_type) = & analyzed_target_ss. key_type
127128 && let Some ( existing_key_type) = & existing_state. common . key_type
@@ -196,7 +197,10 @@ fn build_target_id(
196197 } ) ;
197198 }
198199 }
199- Ok ( target_id)
200+ Ok ( ExportOpExecutionContext {
201+ target_id,
202+ schema_version_id,
203+ } )
200204}
201205
202206pub fn build_flow_setup_execution_context (
@@ -276,18 +280,17 @@ pub fn build_flow_setup_execution_context(
276280 . targets
277281 . iter ( )
278282 . map ( |analyzed_target_ss| {
279- let target_id = build_target_id (
283+ build_export_op_exec_ctx (
280284 analyzed_target_ss,
281285 & target_states_by_name_type,
282286 & mut metadata,
283287 & mut target_states,
284- ) ?;
285- Ok ( ExportOpExecutionContext { target_id } )
288+ )
286289 } )
287290 . collect :: < Result < Vec < _ > > > ( ) ?;
288291
289292 for analyzed_target_ss in analyzed_ss. declarations . iter ( ) {
290- build_target_id (
293+ build_export_op_exec_ctx (
291294 analyzed_target_ss,
292295 & target_states_by_name_type,
293296 & mut metadata,
0 commit comments