Sha256: 2e91c08e0c56af527b409feca5f033f953d441b21960834ad5b6abe3f1f9c8cf

Contents?: true

Size: 518 Bytes

Versions: 9

Compression:

Stored size: 518 Bytes

Contents

class CreateIgnores < ActiveRecord::Migration
  def up
    create_table :recommendable_ignores do |t|
      t.references :user
      t.references :ignorable, :polymorphic => true
      t.timestamps
    end
    
    add_index :recommendable_ignores, :ignorable_id
    add_index :recommendable_ignores, :ignorable_type
    add_index :recommendable_ignores, [:user_id, :ignorable_id, :ignorable_type], :unique => true, :name => "user_ignore_constraint"
  end
  
  def down
    drop_table :recommendable_ignores
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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