Commit 0c90737b authored by Andreas Brandl's avatar Andreas Brandl Committed by Toon Claes

Fix not-null inconsistency

Refer to https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31886 for
details

This mostly aligns GitLab.com (and perhaps gdk environments) to use the
same `NOT NULL` constraints instead of `CHECK` constraints.
parent 7c15e864
---
title: Fix database schema inconsistency with not-null checks
merge_request: 31930
author:
type: other
# 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
......@@ -13817,6 +13817,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200511162115
20200512085150
20200512164334
20200513160930
20200513234502
20200513235347
20200513235532
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment