Sha256: b68cfb73830979391fa6ee09c8d9dc5287d7c69edc50736f7114bc2d4fc28971
Contents?: true
Size: 497 Bytes
Versions: 12
Compression:
Stored size: 497 Bytes
Contents
class CreateLikes < ActiveRecord::Migration def up create_table :recommendable_likes do |t| t.references :user t.references :likeable, :polymorphic => true t.timestamps end add_index :recommendable_likes, :likeable_id add_index :recommendable_likes, :likeable_type add_index :recommendable_likes, [:user_id, :likeable_id, :likeable_type], :unique => true, :name => "user_like_constraint" end def down drop_table :recommendable_likes end end
Version data entries
12 entries across 12 versions & 1 rubygems