2020-07-10 13:33:13 +00:00
|
|
|
class AddProUsersFeedMaterializedView < ActiveRecord::Migration[5.2]
|
|
|
|
def change
|
2020-07-10 13:38:10 +00:00
|
|
|
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
|
2020-07-10 13:45:25 +00:00
|
|
|
SQL
|
2020-07-10 13:38:10 +00:00
|
|
|
}
|
2020-07-10 13:33:13 +00:00
|
|
|
end
|
|
|
|
end
|