docbrown/db/migrate/20170208152018_acts_as_follower_migration.rb
leewynne 5b50d52b5f Replaced hard coded AWS region in carrierwave.rb and sitemaps.rb. Updated legacy migration files to include pre rails 5 version (this resolved new instances on Heroku) (#4874) [deploy]
* missing rails version 4.2 added to pre 5 migrations

* updated carrierwave.rb and sitemap.rb with AWS_DEFAULT_REGION
2019-11-22 09:07:59 -05:00

17 lines
579 B
Ruby

class ActsAsFollowerMigration < ActiveRecord::Migration[4.2]
def self.up
create_table :follows, :force => true do |t|
t.references :followable, :polymorphic => true, :null => false
t.references :follower, :polymorphic => true, :null => false
t.boolean :blocked, :default => false, :null => false
t.timestamps
end
add_index :follows, ["follower_id", "follower_type"], :name => "fk_follows"
add_index :follows, ["followable_id", "followable_type"], :name => "fk_followables"
end
def self.down
drop_table :follows
end
end