2018-11-13 07:27:31 +00:00
|
|
|
class EnsureLockVersionHasNoDefault < ActiveRecord::Migration[4.2]
|
2016-08-30 19:44:11 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def up
|
|
|
|
change_column_default :issues, :lock_version, nil
|
|
|
|
change_column_default :merge_requests, :lock_version, nil
|
|
|
|
|
|
|
|
execute('UPDATE issues SET lock_version = 1 WHERE lock_version = 0')
|
|
|
|
execute('UPDATE merge_requests SET lock_version = 1 WHERE lock_version = 0')
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
end
|
|
|
|
end
|