Commit aeb123e7 authored by Mike Kozono's avatar Mike Kozono

Add not null constraint on external_diff_store

But ignoring existing rows.

After we do this, then we update existing rows. Then we can enforce no
`NULL`s.
parent 4985c56c
# frozen_string_literal: true
class AddNotNullConstraintOnExternalDiffStoreToMergeRequestDiffs < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_not_null_constraint(:merge_request_diffs, :external_diff_store, validate: false)
end
def down
remove_not_null_constraint(:merge_request_diffs, :external_diff_store)
end
end
3177e2f9549add35789e64b14c5958c4fb42fdce4b4705505bc9bbe326d9a875
\ No newline at end of file
......@@ -17613,6 +17613,9 @@ ALTER TABLE public.design_management_designs
ALTER TABLE public.vulnerability_scanners
ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID;
ALTER TABLE public.merge_request_diffs
ADD CONSTRAINT check_93ee616ac9 CHECK ((external_diff_store IS NOT NULL)) NOT VALID;
ALTER TABLE ONLY public.ci_build_needs
ADD CONSTRAINT ci_build_needs_pkey PRIMARY KEY (id);
......
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