File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/main/resources/db/migration Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,21 @@ group by
1515 ` o` .` expiry_date` ,
1616 ` o` .` max_active_transaction_count` ,
1717 ` o` .` note` ;
18+
19+ CREATE OR REPLACE VIEW `transaction ` AS
20+ SELECT
21+ tx1 .transaction_pk ,
22+ tx1 .connector_pk ,
23+ tx1 .id_tag ,
24+ tx1 .event_timestamp as ' start_event_timestamp' ,
25+ tx1 .start_timestamp ,
26+ tx1 .start_value ,
27+ tx2 .event_actor as ' stop_event_actor' ,
28+ tx2 .event_timestamp as ' stop_event_timestamp' ,
29+ tx2 .stop_timestamp ,
30+ tx2 .stop_value ,
31+ tx2 .stop_reason
32+ FROM transaction_start tx1
33+ LEFT JOIN transaction_stop tx2
34+ ON tx1 .transaction_pk = tx2 .transaction_pk
35+ AND tx2 .event_timestamp = (SELECT MAX (event_timestamp) FROM transaction_stop s2 WHERE tx2 .transaction_pk = s2 .transaction_pk )
You can’t perform that action at this time.
0 commit comments