Sha256: ee29cb116ab5efc43519ecca09825fe5584ecd64b571a888f503222396984e64

Contents?: true

Size: 519 Bytes

Versions: 9

Compression:

Stored size: 519 Bytes

Contents

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
recommendable-1.1.7 db/migrate/20120131173909_create_stashes.rb
recommendable-1.1.6 db/migrate/20120131173909_create_stashes.rb
recommendable-1.1.5 db/migrate/20120131173909_create_stashes.rb
recommendable-1.1.4 db/migrate/20120131173909_create_stashes.rb
recommendable-1.1.3 db/migrate/20120131173909_create_stashes.rb
recommendable-1.1.2 db/migrate/20120131173909_create_stashes.rb
recommendable-1.1.1 db/migrate/20120131173909_create_stashes.rb
recommendable-1.0.0 db/migrate/20120131173909_create_stashes.rb
recommendable-0.2.1.1 db/migrate/20120131173909_create_stashes.rb