debian-mirror-gitlab/db/migrate/20200513160930_fix_not_null_check_constraint_inconsistency.rb
2020-05-24 23:13:21 +05:30

21 lines
557 B
Ruby

# frozen_string_literal: true
class FixNotNullCheckConstraintInconsistency < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
table = :application_settings
%i(container_registry_vendor container_registry_version).each do |column|
change_column_null table, column, false
remove_not_null_constraint(table, column) if check_not_null_constraint_exists?(table, column)
end
end
def down
# No-op: for regular systems without the inconsistency, #up is a no-op, too
end
end