feat(sql): Add target and host history tables to session recording

This adds four columns to the `recording_session` table which are
foreign keys to the `iam_scope_hst`, `target_ssh_hst`,
`host_history_base`, and `host_catalog_history_base` tables. The foreign
key to the `iam_scope_hst` table references the project scope of the
target at the time of the recording.
This commit is contained in:
Michael Gaffney authored and Timothy Messier committed 2023-05-31 12:18:17 +00:00
1 parent 73b710cd06
commit 477e6df269
14 files changed
+220 -118

No files matched your search

@@ -10,9 +10,9 @@ begin;
select is(count(*), 1::bigint) from session_state where session_id = 's1_____ciara' and state='canceling';
select is(count(*), 1::bigint) from session_state where session_id = 's1_____carly' and state='active';
-- Check that we have 4 sessions using this host set
select is(count(*), 4::bigint) from session_host_set_host where host_set_id = 's___1cb-sths';
-- Check that we have 5 sessions using this host set
select is(count(*), 5::bigint) from session_host_set_host where host_set_id = 's___1cb-sths';
-- Delete host set, expect no errors
delete from host_set where public_id = 's___1cb-sths';
select is(count(*), 0::bigint) from host_set where public_id = 's___1cb-sths';
@@ -25,4 +25,4 @@ begin;
select is(count(*), 1::bigint) from session_state where state = 'canceling' and session_id = 's1_____carly';
select * from finish();
rollback;
rollback;