gitlab-org--gitlab-foss/db/post_migrate/20190424134256_drop_projects_ci_id.rb
Dmitriy Zaporozhets ee7d2c1b2f
Remove unused projects.ci_id column
And remove Gitlab::Ci::Trace#deprecated_path as it relies on ci_id

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2019-05-02 17:55:28 +03:00

28 lines
686 B
Ruby

# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class DropProjectsCiId < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
disable_ddl_transaction!
def up
if index_exists?(:projects, :ci_id)
remove_concurrent_index :projects, :ci_id
end
if column_exists?(:projects, :ci_id)
remove_column :projects, :ci_id
end
end
def down
add_column :projects, :ci_id, :integer
add_concurrent_index :projects, :ci_id
end
end