diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-05-23 15:40:00 +0000 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-05-23 10:59:08 -0500 |
commit | 5144ba36d0763bd2d67436d397f7bbea7341e7bd (patch) | |
tree | 164727c5e7e424c469a594dfe11de4e0b63827a1 | |
parent | b2f54bc68f0469ad56b9f26b20e460f995300ea2 (diff) | |
download | gitlab-ce-5144ba36d0763bd2d67436d397f7bbea7341e7bd.tar.gz |
Merge branch '46630-add-missing-columns-to-project-mirror-data' into 'master'
Upgrading from EE to CE fails on project_mirror_data migrations
Closes #46630
See merge request gitlab-org/gitlab-ce!19109
-rw-r--r-- | changelogs/unreleased/46630-add-missing-columns-to-project-mirror-data.yml | 5 | ||||
-rw-r--r-- | db/migrate/20180503175053_ensure_missing_columns_to_project_mirror_data.rb | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/changelogs/unreleased/46630-add-missing-columns-to-project-mirror-data.yml b/changelogs/unreleased/46630-add-missing-columns-to-project-mirror-data.yml new file mode 100644 index 00000000000..cc153b85440 --- /dev/null +++ b/changelogs/unreleased/46630-add-missing-columns-to-project-mirror-data.yml @@ -0,0 +1,5 @@ +--- +title: Fix project mirror database inconsistencies when upgrading from EE to CE +merge_request: 19109 +author: +type: fixed diff --git a/db/migrate/20180503175053_ensure_missing_columns_to_project_mirror_data.rb b/db/migrate/20180503175053_ensure_missing_columns_to_project_mirror_data.rb new file mode 100644 index 00000000000..970a53d68d0 --- /dev/null +++ b/db/migrate/20180503175053_ensure_missing_columns_to_project_mirror_data.rb @@ -0,0 +1,15 @@ +class EnsureMissingColumnsToProjectMirrorData < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + add_column :project_mirror_data, :status, :string unless column_exists?(:project_mirror_data, :status) + add_column :project_mirror_data, :jid, :string unless column_exists?(:project_mirror_data, :jid) + add_column :project_mirror_data, :last_error, :text unless column_exists?(:project_mirror_data, :last_error) + end + + def down + # db/migrate/20180502122856_create_project_mirror_data.rb will remove the table + end +end |