Update 20200710130615_add_pro_users_feed_materialized_view.rb
This commit is contained in:
parent
d5293c2e1d
commit
02c71b8af9
@ -1,13 +1,15 @@
|
|||||||
class AddProUsersFeedMaterializedView < ActiveRecord::Migration[5.2]
|
class AddProUsersFeedMaterializedView < ActiveRecord::Migration[5.2]
|
||||||
def change
|
def change
|
||||||
execute <<-SQL
|
safety_assured {
|
||||||
CREATE MATERIALIZED VIEW pro_feed_users_matview AS
|
execute <<-SQL
|
||||||
SELECT id
|
CREATE MATERIALIZED VIEW pro_feed_users_matview AS
|
||||||
FROM accounts
|
SELECT id
|
||||||
WHERE accounts.is_investor=true
|
FROM accounts
|
||||||
OR accounts.is_donor=true
|
WHERE accounts.is_investor=true
|
||||||
OR accounts.is_verified=true
|
OR accounts.is_donor=true
|
||||||
OR accounts.is_pro=true
|
OR accounts.is_verified=true
|
||||||
SQL
|
OR accounts.is_pro=true
|
||||||
|
SQL
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user