Commit ae1b7af2 authored by Mark Chao's avatar Mark Chao

Merge branch 'remove-not-null-constraint-for-public-email' into 'master'

Remove not_null constraint and default for public_email

See merge request gitlab-org/gitlab!72514
parents 97ee889c 9ba66b01
# frozen_string_literal: true
class RemoveNotNullConstraintAndDefaultForPublicEmail < Gitlab::Database::Migration[1.0]
enable_lock_retries!
def up
change_column_null :users, :public_email, true
change_column_default :users, :public_email, from: '', to: nil
end
def down
# There may now be nulls in the table, so we cannot re-add the constraint here.
change_column_default :users, :public_email, from: nil, to: ''
end
end
fcee17f25ad3a8b6fb56c23b72978f4a6952200264d285b9e3df4b5e7733e8f6
\ No newline at end of file
......@@ -20194,7 +20194,7 @@ CREATE TABLE users (
encrypted_otp_secret_salt character varying,
otp_required_for_login boolean DEFAULT false NOT NULL,
otp_backup_codes text,
public_email character varying DEFAULT ''::character varying NOT NULL,
public_email character varying,
dashboard integer DEFAULT 0,
project_view integer DEFAULT 0,
consumed_timestep integer,
......@@ -498,7 +498,7 @@ RSpec.describe API::Members do
end
context 'when members have no public_email' do
it { is_expected.to include(a_hash_including('email' => '')) }
it { is_expected.to include(a_hash_including('email' => nil)) }
end
end
end
......
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