Skip to content

Commit

Permalink
feat: Add missing migration
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Dec 30, 2023
1 parent 153ebef commit 70a5175
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions supabase/migrations/20231230130623_get_bulk_results.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CREATE OR REPLACE FUNCTION get_bulk_results(id_param INT)
RETURNS TABLE(
id integer,
email text,
is_reachable is_reachable_type,
result json,
verified_at timestamptz
) AS $$
BEGIN
RETURN QUERY
SELECT
c.bulk_email_id as id,
b.email,
c.is_reachable,
c.result,
c.created_at as verified_at
FROM
calls c
INNER JOIN
bulk_emails b ON c.bulk_email_id = b.id
WHERE
b.bulk_job_id = id_param;
END;
$$ LANGUAGE plpgsql;

0 comments on commit 70a5175

Please sign in to comment.