Sha256: a0b5a06df1685acbb08c8c86a2dabf7fd48203c307008fa58a3c59360746ac9d

Contents?: true

Size: 512 Bytes

Versions: 3

Compression:

Stored size: 512 Bytes

Contents

# This migration comes from recommendable (originally 20120124193723)
class CreateLikes < ActiveRecord::Migration
  def up
    create_table :likes, :force => true do |t|
      t.references :user
      t.references :likeable, :polymorphic => true
      t.timestamps
    end
    
    add_index :likes, :likeable_id
    add_index :likes, :likeable_type
    add_index :likes, [:user_id, :likeable_id, :likeable_type], :unique => true, :name => "user_like_constraint"
  end

  def down
    drop_table :likes
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
recommendable-0.1.4 spec/dummy/db/migrate/20120128005553_create_likes.recommendable.rb
recommendable-0.1.3 spec/dummy/db/migrate/20120128005553_create_likes.recommendable.rb
recommendable-0.1.2 spec/dummy/db/migrate/20120128005553_create_likes.recommendable.rb