Sha256: e8b358f30e0386c3aaae0c4c284028afa379fe6f50e3a21d25f2e96c2b06baee

Contents?: true

Size: 439 Bytes

Versions: 3

Compression:

Stored size: 439 Bytes

Contents

class AddFollowsMigration < ActiveRecord::Migration
  def up
    create_table :follows do |t|
      t.references :followable, polymorphic: true
      t.references :follower, polymorphic: true

      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 down
    drop_table :follows
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
partisan-0.1.1 lib/generators/partisan/templates/migration.rb
partisan-0.1 lib/generators/partisan/templates/migration.rb
partisan-0.0.1 lib/generators/partisan/templates/migration.rb