Sha256: 037a1e5b94b70468b913cd1cbd62c260620071d256056f9f410a81a70953c434

Contents?: true

Size: 484 Bytes

Versions: 3

Compression:

Stored size: 484 Bytes

Contents

class CreateStashedItems < ActiveRecord::Migration
  def up
    create_table :stashed_items do |t|
      t.references :user
      t.references :stashable, :polymorphic => true
      t.timestamps
    end
    
    add_index :stashed_items, :stashable_id
    add_index :stashed_items, :stashable_type
    add_index :stashed_items, [:user_id, :stashable_id, :stashable_type], :unique => true, :name => "user_stashed_constraint"
  end
  
  def down
    drop_table :stashed_items
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
recommendable-0.1.4 db/migrate/20120131173909_create_stashed_items.rb
recommendable-0.1.3 db/migrate/20120131173909_create_stashed_items.rb
recommendable-0.1.2 db/migrate/20120131173909_create_stashed_items.rb