2018-12-23 12:14:25 +05:30
|
|
|
class EnsureLockVersionHasNoDefault < ActiveRecord::Migration[4.2]
|
2016-09-29 09:46:39 +05:30
|
|
|
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
|