fedibird-fe/db/migrate/20211213083734_update_follow_recommendations_to_version_3.rb

14 lines
566 B
Ruby
Raw Normal View History

class UpdateFollowRecommendationsToVersion3 < ActiveRecord::Migration[6.1]
def up
drop_view :follow_recommendations, materialized: true
create_view :follow_recommendations, version: 3, materialized: { no_data: true }
safety_assured { add_index :follow_recommendations, :account_id, unique: true }
end
def down
drop_view :follow_recommendations, materialized: true
create_view :follow_recommendations, version: 2, materialized: { no_data: true }
safety_assured { add_index :follow_recommendations, :account_id, unique: true }
end
end