@@ -21,6 +21,7 @@ DRepActivity AS (
2121SELECT
2222 encode(dh .raw , ' hex' ),
2323 dh .view ,
24+ dh .has_script ,
2425 va .url ,
2526 encode(va .data_hash , ' hex' ),
2627 dr_deposit .deposit ,
3031 newestRegister .time AS last_register_time,
3132 COALESCE(latestDeposit .deposit , 0 ),
3233 non_deregister_voting_anchor .url IS NOT NULL AS has_non_deregister_voting_anchor,
33- off_chain_vote_fetch_error . fetch_error ,
34+ fetch_error . message ,
3435 off_chain_vote_drep_data .payment_address ,
3536 off_chain_vote_drep_data .given_name ,
3637 off_chain_vote_drep_data .objectives ,
9697 LEFT JOIN DRepDistr ON DRepDistr .hash_id = dh .id
9798 AND DRepDistr .rn = 1
9899 LEFT JOIN voting_anchor va ON va .id = dr_voting_anchor .voting_anchor_id
99- LEFT JOIN voting_anchor non_deregister_voting_anchor on non_deregister_voting_anchor .id = dr_non_deregister_voting_anchor .voting_anchor_id
100- LEFT JOIN off_chain_vote_fetch_error ON off_chain_vote_fetch_error .voting_anchor_id = va .id
100+ LEFT JOIN voting_anchor non_deregister_voting_anchor ON non_deregister_voting_anchor .id = dr_non_deregister_voting_anchor .voting_anchor_id
101+ LEFT JOIN (
102+ SELECT fetch_error as message, voting_anchor_id
103+ FROM off_chain_vote_fetch_error
104+ WHERE fetch_time = (
105+ SELECT max (fetch_time)
106+ FROM off_chain_vote_fetch_error)
107+ GROUP BY fetch_error, voting_anchor_id
108+ ) AS fetch_error ON fetch_error .voting_anchor_id = va .id
101109 LEFT JOIN off_chain_vote_data ON off_chain_vote_data .voting_anchor_id = va .id
102110 LEFT JOIN off_chain_vote_drep_data on off_chain_vote_drep_data .off_chain_vote_data_id = off_chain_vote_data .id
103111 CROSS JOIN DRepActivity
@@ -130,6 +138,7 @@ GROUP BY
130138 dh .raw ,
131139 second_to_newest_drep_registration .voting_anchor_id ,
132140 dh .view ,
141+ dh .has_script ,
133142 va .url ,
134143 va .data_hash ,
135144 dr_deposit .deposit ,
@@ -140,7 +149,7 @@ GROUP BY
140149 newestRegister .time ,
141150 latestDeposit .deposit ,
142151 non_deregister_voting_anchor .url ,
143- off_chain_vote_fetch_error . fetch_error ,
152+ fetch_error . message ,
144153 off_chain_vote_drep_data .payment_address ,
145154 off_chain_vote_drep_data .given_name ,
146155 off_chain_vote_drep_data .objectives ,
0 commit comments