From 02c71b8af982205910575312f659807b3a6e9640 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 10 Jul 2020 13:38:10 +0000 Subject: [PATCH] Update 20200710130615_add_pro_users_feed_materialized_view.rb --- ...15_add_pro_users_feed_materialized_view.rb | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/db/migrate/20200710130615_add_pro_users_feed_materialized_view.rb b/db/migrate/20200710130615_add_pro_users_feed_materialized_view.rb index a50ae461..19dfc3b3 100644 --- a/db/migrate/20200710130615_add_pro_users_feed_materialized_view.rb +++ b/db/migrate/20200710130615_add_pro_users_feed_materialized_view.rb @@ -1,13 +1,15 @@ 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 + safety_assured { + 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