2022-07-22 13:31:37 +02:00
|
|
|
|
|
|
|
-- ========================================================
|
2024-08-29 17:00:19 +02:00
|
|
|
-- Historization twiddle
|
2022-07-22 13:31:37 +02:00
|
|
|
-- --------------------------------------------------------
|
|
|
|
|
2024-08-29 17:00:19 +02:00
|
|
|
rollback;
|
|
|
|
begin transaction;
|
|
|
|
call defineContext('historization testing', null, 'superuser-alex@hostsharing.net',
|
|
|
|
-- 'hs_booking_project#D-1000000-hshdefaultproject:ADMIN'); -- prod+test
|
|
|
|
'hs_booking_project#D-1000313-D-1000313defaultproject:ADMIN'); -- prod+test
|
|
|
|
-- 'hs_booking_project#D-1000300-mihdefaultproject:ADMIN'); -- prod
|
|
|
|
-- 'hs_booking_project#D-1000300-mimdefaultproject:ADMIN'); -- test
|
|
|
|
-- update hs_hosting_asset set caption='lug00 b' where identifier = 'lug00' and type = 'MANAGED_WEBSPACE'; -- prod
|
|
|
|
-- update hs_hosting_asset set caption='hsh00 A ' || now()::text where identifier = 'hsh00' and type = 'MANAGED_WEBSPACE'; -- test
|
|
|
|
-- update hs_hosting_asset set caption='hsh00 B ' || now()::text where identifier = 'hsh00' and type = 'MANAGED_WEBSPACE'; -- test
|
|
|
|
|
|
|
|
-- insert into hs_hosting_asset
|
|
|
|
-- (uuid, bookingitemuuid, type, parentassetuuid, assignedtoassetuuid, identifier, caption, config, alarmcontactuuid)
|
|
|
|
-- values
|
|
|
|
-- (uuid_generate_v4(), null, 'EMAIL_ADDRESS', 'bbda5895-0569-4e20-bb4c-34f3a38f3f63'::uuid, null,
|
|
|
|
-- 'new@thi.example.org', 'some new E-Mail-Address', '{}'::jsonb, null);
|
|
|
|
|
|
|
|
delete from hs_hosting_asset where uuid='5aea68d2-3b55-464f-8362-b05c76c5a681'::uuid;
|
|
|
|
commit;
|
|
|
|
|
|
|
|
-- single version at point in time
|
2024-09-16 15:36:37 +02:00
|
|
|
-- set hsadminng.tx_history_txid to (select max(txid) from base.tx_context where txtimestamp<='2024-08-27 12:13:13.450821');
|
2024-08-29 17:00:19 +02:00
|
|
|
set hsadminng.tx_history_txid to '';
|
|
|
|
set hsadminng.tx_history_timestamp to '2024-08-29 12:42';
|
|
|
|
-- all versions
|
2024-09-16 15:36:37 +02:00
|
|
|
select base.tx_history_txid(), txc.txtimestamp, txc.currentSubject, txc.currentTask, haex.*
|
2024-08-29 17:00:19 +02:00
|
|
|
from hs_hosting_asset_ex haex
|
2024-09-16 15:36:37 +02:00
|
|
|
join base.tx_context txc on haex.txid=txc.txid
|
2024-08-29 17:00:19 +02:00
|
|
|
where haex.identifier = 'test@thi.example.org';
|
|
|
|
|
|
|
|
select uuid, version, type, identifier, caption from hs_hosting_asset_hv p where identifier = 'test@thi.example.org';
|
|
|
|
|
|
|
|
select pg_current_xact_id();
|
2022-07-22 13:31:37 +02:00
|
|
|
|