Merge pull request #936 from internetee/add-contacts-email-constraint

Change `contacts.email` to NOT NULL
This commit is contained in:
Timo Võhmar 2018-08-28 12:54:47 +03:00 committed by GitHub
commit 39fe8ef6ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 5 deletions

View file

@ -0,0 +1,5 @@
class ChangeContactsEmailToNotNull < ActiveRecord::Migration
def change
change_column_null :contacts, :email, false
end
end

View file

@ -613,7 +613,7 @@ CREATE TABLE public.contacts (
id integer NOT NULL,
code character varying NOT NULL,
phone character varying,
email character varying,
email character varying NOT NULL,
fax character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
@ -4761,3 +4761,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180613045614');
INSERT INTO schema_migrations (version) VALUES ('20180713154915');
INSERT INTO schema_migrations (version) VALUES ('20180816123540');

View file

@ -21,8 +21,8 @@ class ContactVersionsTest < ApplicationSystemTestCase
VALUES (75, 'test_registrar', 'test123', 'test@test.com', 'EE', 'TEST123',
'test123', 'en');
INSERT INTO contacts (id, code, auth_info, registrar_id)
VALUES (75, 'test_code', '8b4d462aa04194ca78840a', 75);
INSERT INTO contacts (id, code, email, auth_info, registrar_id)
VALUES (75, 'test_code', 'test@inbox.test', '8b4d462aa04194ca78840a', 75);
INSERT INTO log_contacts (item_type, item_id, event, whodunnit, object,
object_changes, created_at, session, children, ident_updated_at, uuid)

View file

@ -21,8 +21,8 @@ class DomainVersionsTest < ApplicationSystemTestCase
VALUES (54, 'test_registrar', 'test123', 'test@test.com', 'EE', 'TEST123',
'test123', 'en');
INSERT INTO contacts (id, code, auth_info, registrar_id)
VALUES (54, 'test_code', '8b4d462aa04194ca78840a', 54);
INSERT INTO contacts (id, code, email, auth_info, registrar_id)
VALUES (54, 'test_code', 'test@inbox.test', '8b4d462aa04194ca78840a', 54);
INSERT INTO domains (id, registrar_id, valid_to, registrant_id,
transfer_code)