Sha256: 90907f0af3e130791458b73ecb537340f337f8db23c0bad35e156de404c06766

Contents?: true

Size: 510 Bytes

Versions: 10

Compression:

Stored size: 510 Bytes

Contents

class ActsAsFollowableMigration < ActiveRecord::Migration
  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.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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
acts_as_followable-0.1.9 lib/generators/templates/migration.rb
acts_as_followable-0.1.8 lib/generators/templates/migration.rb
acts_as_followable-0.1.7 lib/generators/templates/migration.rb
acts_as_followable-0.1.6 lib/generators/templates/migration.rb
acts_as_followable-0.1.5 lib/generators/templates/migration.rb
acts_as_followable-0.1.4 lib/generators/templates/migration.rb
acts_as_followable-0.1.3 lib/generators/templates/migration.rb
acts_as_followable-0.1.2 lib/generators/templates/migration.rb
acts_as_followable-0.1.1 lib/generators/templates/migration.rb
acts_as_followable-0.1.0 lib/generators/templates/migration.rb