Only show claim related events in activity feed

This commit is contained in:
Teemu Patja 2017-10-27 09:19:47 +03:00
parent 35bef82b6e
commit 6f2cb1c2a5
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
CREATE OR REPLACE VIEW "public"."activity_feed_view" AS SELECT 'open-claim'::text AS type,
claims_view.issue_title,
claims_view.repo_name,
claims_view.repo_owner,
claims_view.issue_number,
claims_view.user_name,
claims_view.user_avatar_url,
claims_view.balance_eth,
claims_view.tokens,
claims_view.value_usd,
claims_view.updated
FROM claims_view
WHERE claims_view.pr_state = 0 AND claims_view.payout_receipt IS NULL AND claims_view.issue_open IS TRUE
UNION
SELECT 'claim-payout'::text AS type,
claims_view.issue_title,
claims_view.repo_name,
claims_view.repo_owner,
claims_view.issue_number,
claims_view.user_name,
claims_view.user_avatar_url,
claims_view.balance_eth,
claims_view.tokens,
claims_view.value_usd,
claims_view.updated
FROM claims_view
WHERE claims_view.pr_state = 1 AND claims_view.payout_receipt IS NOT NULL
ORDER BY 11 DESC;