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

12 lines
373 B
Ruby

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