2020-06-17 18:09:08 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-06-18 15:08:45 +00:00
|
|
|
class RestorePreviousSchemaWithoutLockVersionNullConstraint < ActiveRecord::Migration[6.0]
|
2020-06-17 18:09:08 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
2020-06-18 15:08:45 +00:00
|
|
|
TABLES = %i(epics merge_requests issues ci_stages ci_builds ci_pipelines).freeze
|
2020-06-17 18:09:08 +00:00
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
TABLES.each do |table|
|
2020-06-18 15:08:45 +00:00
|
|
|
remove_not_null_constraint table, :lock_version
|
2020-06-17 18:09:08 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2020-06-18 15:08:45 +00:00
|
|
|
# no-op
|
2020-06-17 18:09:08 +00:00
|
|
|
end
|
|
|
|
end
|