diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-05-02 16:56:48 +0000 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-05-02 16:56:48 +0000 |
commit | 4e67122e389708d766a2a90daa059f05b0f980c5 (patch) | |
tree | 0c21d8bd49f122440e41d31b68d4228782fd91e4 /db | |
parent | d753336eb56bcd8485fd2774d54ddcba9161f5e3 (diff) | |
parent | ee7d2c1b2f91a299179cbb0b36e1b870b6c36903 (diff) | |
download | gitlab-ce-4e67122e389708d766a2a90daa059f05b0f980c5.tar.gz |
Merge branch '27777-drop-projects-ci_id-column' into 'master'
Resolve "Drop "projects"."ci_id" column"
Closes #27777
See merge request gitlab-org/gitlab-ce!27623
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20190424134256_drop_projects_ci_id.rb | 28 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 28 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 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 diff --git a/db/schema.rb b/db/schema.rb index 11230d4e691..de9e6f0b40d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1738,7 +1738,6 @@ ActiveRecord::Schema.define(version: 20190426180107) do t.string "import_type" t.string "import_source" t.text "import_error" - t.integer "ci_id" t.boolean "shared_runners_enabled", default: true, null: false t.string "runners_token" t.string "build_coverage_regex" @@ -1777,7 +1776,6 @@ ActiveRecord::Schema.define(version: 20190426180107) do t.string "bfg_object_map" t.boolean "detected_repository_languages" t.string "external_authorization_classification_label" - t.index ["ci_id"], name: "index_projects_on_ci_id", using: :btree t.index ["created_at"], name: "index_projects_on_created_at", using: :btree t.index ["creator_id"], name: "index_projects_on_creator_id", using: :btree t.index ["description"], name: "index_projects_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"} |