Adds migration to ensure all remote mirror columns get created
This commit is contained in:
parent
c5adf04cd6
commit
4a344a1549
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Fix remote mirror database inconsistencies when upgrading from EE to CE
|
||||||
|
merge_request: 19196
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -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
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20180524132016) do
|
ActiveRecord::Schema.define(version: 20180529093006) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
Loading…
Reference in New Issue