diff options
author | Sean McGivern <sean@gitlab.com> | 2019-05-17 11:41:24 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-05-20 13:20:56 +0000 |
commit | 0ba5e978ea32893c8c6a92642707eaabbe4dbf36 (patch) | |
tree | e18d4c8e992321db7d431e42e652641e8115d5d2 | |
parent | c9f1848451cf59b69e4a09d49ae20dc0c10060a6 (diff) | |
download | gitlab-ce-11-11-stable-prepare-rc4.tar.gz |
Merge branch 'dz-improve-ci-id-migration' into 'master'11-11-stable-prepare-rc4
Add extra checks for ci_id migration
See merge request gitlab-org/gitlab-ce!28404
(cherry picked from commit 30a60ee4a0373b184bc1a825bf332ee357d5f899)
5786de36 Add extra checks for ci_id migration
-rw-r--r-- | db/post_migrate/20190424134256_drop_projects_ci_id.rb | 9 |
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 |