diff options
author | James Lopez <james@gitlab.com> | 2018-05-30 13:54:30 +0000 |
---|---|---|
committer | James Lopez <james@gitlab.com> | 2018-05-30 13:54:30 +0000 |
commit | 4e47fdb78e7cc1b961965496138bf0b16731f597 (patch) | |
tree | e2fa5648b3b4d943804249e95d713b81cd5bf6fc | |
parent | bb68a89ac4f8d9e74c904101c36ff3dff63d024f (diff) | |
parent | 31c455e442c7c0b416638088ad89b9a58bd4c4cb (diff) | |
download | gitlab-ce-4e47fdb78e7cc1b961965496138bf0b16731f597.tar.gz |
Merge branch '10-8-stable-patch-3-fix-conflicts-19196' into '10-8-stable-patch-3'
Fix conlicts for Adds migration to ensure all remote mirror columns get created when picking into 10-8-stable-patch-3
See merge request gitlab-org/gitlab-ce!19241
-rw-r--r-- | changelogs/unreleased/ensure-remote-mirror-columns-in-ce.yml | 5 | ||||
-rw-r--r-- | db/migrate/20180529093006_ensure_remote_mirror_columns.rb | 24 | ||||
-rw-r--r-- | db/schema.rb | 2 |
3 files changed, 30 insertions, 1 deletions
diff --git a/changelogs/unreleased/ensure-remote-mirror-columns-in-ce.yml b/changelogs/unreleased/ensure-remote-mirror-columns-in-ce.yml new file mode 100644 index 00000000000..7617412431f --- /dev/null +++ b/changelogs/unreleased/ensure-remote-mirror-columns-in-ce.yml @@ -0,0 +1,5 @@ +--- +title: Fix remote mirror database inconsistencies when upgrading from EE to CE +merge_request: 19196 +author: +type: fixed diff --git a/db/migrate/20180529093006_ensure_remote_mirror_columns.rb b/db/migrate/20180529093006_ensure_remote_mirror_columns.rb new file mode 100644 index 00000000000..290416cb61c --- /dev/null +++ b/db/migrate/20180529093006_ensure_remote_mirror_columns.rb @@ -0,0 +1,24 @@ +class EnsureRemoteMirrorColumns < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column :remote_mirrors, :last_update_started_at, :datetime unless column_exists?(:remote_mirrors, :last_update_started_at) + add_column :remote_mirrors, :remote_name, :string unless column_exists?(:remote_mirrors, :remote_name) + + unless column_exists?(:remote_mirrors, :only_protected_branches) + add_column_with_default(:remote_mirrors, + :only_protected_branches, + :boolean, + default: false, + allow_null: false) + end + end + + def down + # db/migrate/20180503131624_create_remote_mirrors.rb will remove the table + end +end diff --git a/db/schema.rb b/db/schema.rb index 168ab198025..393114e3a3c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180508102840) do +ActiveRecord::Schema.define(version: 20180529093006) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" |