2019-02-15 15:39:39 +05:30
|
|
|
class EnsureRemoteMirrorColumns < ActiveRecord::Migration[4.2]
|
2018-10-15 14:42:47 +05:30
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
2018-11-18 11:00:15 +05:30
|
|
|
# rubocop:disable Migration/Datetime
|
2018-10-15 14:42:47 +05:30
|
|
|
add_column :remote_mirrors, :last_update_started_at, :datetime unless column_exists?(:remote_mirrors, :last_update_started_at)
|
2019-12-04 20:38:33 +05:30
|
|
|
add_column :remote_mirrors, :remote_name, :string unless column_exists?(:remote_mirrors, :remote_name) # rubocop:disable Migration/AddLimitToStringColumns
|
2018-10-15 14:42:47 +05:30
|
|
|
|
|
|
|
unless column_exists?(:remote_mirrors, :only_protected_branches)
|
2020-04-08 14:13:33 +05:30
|
|
|
add_column_with_default(:remote_mirrors,
|
2018-10-15 14:42:47 +05:30
|
|
|
: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
|