#168: updated migration

This commit is contained in:
Vokhmin Alexey V 2013-07-01 17:47:15 +04:00
parent 004c45eb28
commit 8248ab3614
1 changed files with 12 additions and 2 deletions

View File

@ -1,7 +1,17 @@
class DropBsIdFromBuildLists < ActiveRecord::Migration class DropBsIdFromBuildLists < ActiveRecord::Migration
def change
remove_index :build_lists, :bs_id class BuildList < ActiveRecord::Base
end
def up
remove_index :build_lists, :bs_id
remove_column :build_lists, :bs_id remove_column :build_lists, :bs_id
end end
def down
add_column :build_lists, :bs_id, :integer
add_index :build_lists, :bs_id, :unique => true
BuildList.update_all('bs_id = id')
end
end end