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