From d5293c2e1d64e9e29376f2f71608b92c50787779 Mon Sep 17 00:00:00 2001 From: admin1 Date: Fri, 10 Jul 2020 09:33:13 -0400 Subject: [PATCH] added pro_users_feed_matview --- ...10130615_add_pro_users_feed_materialized_view.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 db/migrate/20200710130615_add_pro_users_feed_materialized_view.rb diff --git a/db/migrate/20200710130615_add_pro_users_feed_materialized_view.rb b/db/migrate/20200710130615_add_pro_users_feed_materialized_view.rb new file mode 100644 index 00000000..a50ae461 --- /dev/null +++ b/db/migrate/20200710130615_add_pro_users_feed_materialized_view.rb @@ -0,0 +1,13 @@ +class AddProUsersFeedMaterializedView < ActiveRecord::Migration[5.2] + def change + execute <<-SQL + CREATE MATERIALIZED VIEW pro_feed_users_matview AS + SELECT id + FROM accounts + WHERE accounts.is_investor=true + OR accounts.is_donor=true + OR accounts.is_verified=true + OR accounts.is_pro=true + SQL + end +end