aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/state_impl/payloads.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/proxy/state_impl/payloads.py')
-rw-r--r--src/hydrilla/proxy/state_impl/payloads.py37
1 files changed, 4 insertions, 33 deletions
diff --git a/src/hydrilla/proxy/state_impl/payloads.py b/src/hydrilla/proxy/state_impl/payloads.py
index ffd0ab3..74b8121 100644
--- a/src/hydrilla/proxy/state_impl/payloads.py
+++ b/src/hydrilla/proxy/state_impl/payloads.py
@@ -174,41 +174,12 @@ class ConcretePayloadRef(st.PayloadRef):
(mapping_version_id,), = rows
- cursor.execute(
- '''
- UPDATE
- item_versions
- SET
- installed = 'I'
- WHERE
- item_version_id = ?;
- ''',
- (mapping_version_id,)
- )
-
- cursor.execute(
- '''
- WITH depended_resource_ids AS (
- SELECT
- rdd.resource_item_id
- FROM
- payloads AS p
- JOIN resolved_depended_resources AS rdd
- USING (payload_id)
- WHERE
- payload_id = ?
- )
- UPDATE
- item_versions
- SET
- installed = 'I'
- WHERE
- item_version_id IN depended_resource_ids;
- ''',
- (self.id,)
+ mapping_version_ref = items.ConcreteMappingVersionRef(
+ id = str(mapping_version_id),
+ state = self.state
)
- self.state.pull_missing_files()
+ mapping_version_ref.ensure_depended_items_installed()
def get_script_paths(self) \
-> t.Iterable[t.Sequence[str]]: