Sha256: bc18ba53744d40f691ee7b2295c5e9680f657cf639c46ea6bb9a7e5675f6cbb8
Contents?: true
Size: 846 Bytes
Versions: 6
Compression:
Stored size: 846 Bytes
Contents
class CreateDuneAdminFundingRaisedPerProjectReports < ActiveRecord::Migration def up execute <<-SQL CREATE OR REPLACE VIEW dune_admin_funding_raised_per_project_reports AS SELECT project.id AS project_id, project.name AS project_name, sum(contributions.value) AS total_raised, count(*) AS total_backs, count(DISTINCT contributions.user_id) AS total_backers FROM contributions JOIN projects AS project ON project.id = contributions.project_id WHERE contributions.state::text <> ALL (ARRAY['waiting_confirmation'::character varying::text, 'pending'::character varying::text, 'canceled'::character varying::text, 'deleted']) GROUP BY project.id; SQL end def down drop_view :dune_admin_funding_raised_per_project_reports end end
Version data entries
6 entries across 6 versions & 1 rubygems