rosa-build/db/migrate/20120127234602_add_index_fo...

13 lines
412 B
Ruby
Raw Normal View History

2012-01-30 20:39:34 +00:00
# -*- encoding : utf-8 -*-
class AddIndexForProjectsName < ActiveRecord::Migration
def self.up
add_index :projects, [:name, :owner_id, :owner_type], :unique => true, :case_sensitive => false
add_index :project_imports, :name, :unique => true, :case_sensitive => false
end
def self.down
remove_index :projects, [:name, :owner_id, :owner_type]
remove_index :project_imports, :name
end
end