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

13 lines
412 B
Ruby

# -*- 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