diff options
-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 |