diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-04-24 16:51:48 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-05-02 17:55:28 +0300 |
commit | ee7d2c1b2f91a299179cbb0b36e1b870b6c36903 (patch) | |
tree | f17fdc4b532b4daf342d3e1efac8d4c3faae33a5 /db/post_migrate | |
parent | a8347c22d0e33ab626ee4c3b4b9acffa69f7cf46 (diff) |
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>
Diffstat (limited to 'db/post_migrate')
-rw-r--r-- | db/post_migrate/20190424134256_drop_projects_ci_id.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/db/post_migrate/20190424134256_drop_projects_ci_id.rb b/db/post_migrate/20190424134256_drop_projects_ci_id.rb new file mode 100644 index 00000000000..79fa9704f1f --- /dev/null +++ b/db/post_migrate/20190424134256_drop_projects_ci_id.rb @@ -0,0 +1,28 @@ +# 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 |