summaryrefslogtreecommitdiff
path: root/db/post_migrate/20190424134256_drop_projects_ci_id.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20190424134256_drop_projects_ci_id.rb')
-rw-r--r--db/post_migrate/20190424134256_drop_projects_ci_id.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/db/post_migrate/20190424134256_drop_projects_ci_id.rb b/db/post_migrate/20190424134256_drop_projects_ci_id.rb
index 79fa9704f1f..44e8f316393 100644
--- a/db/post_migrate/20190424134256_drop_projects_ci_id.rb
+++ b/db/post_migrate/20190424134256_drop_projects_ci_id.rb
@@ -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