Add extra checks for ci_id migration
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
f2cb522011
commit
5786de36af
1 changed files with 7 additions and 2 deletions
|
@ -22,7 +22,12 @@ class DropProjectsCiId < ActiveRecord::Migration[5.1]
|
|||
end
|
||||
|
||||
def down
|
||||
add_column :projects, :ci_id, :integer
|
||||
add_concurrent_index :projects, :ci_id
|
||||
unless column_exists?(:projects, :ci_id)
|
||||
add_column :projects, :ci_id, :integer
|
||||
end
|
||||
|
||||
unless index_exists?(:projects, :ci_id)
|
||||
add_concurrent_index :projects, :ci_id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue