mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Merge pull request #1417 from internetee/add-contacts-name-constraint
Change `contacts.name` database column to NOT NULL
This commit is contained in:
commit
86f5c87d04
5 changed files with 14 additions and 8 deletions
|
@ -288,7 +288,7 @@ class Contact < ApplicationRecord
|
|||
end
|
||||
|
||||
def to_s
|
||||
name || '[no name]'
|
||||
name
|
||||
end
|
||||
|
||||
def validate_html
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class ChangeContactsNameToNotNull < ActiveRecord::Migration
|
||||
def change
|
||||
change_column_null :contacts, :name, false
|
||||
end
|
||||
end
|
|
@ -613,7 +613,7 @@ CREATE TABLE public.contacts (
|
|||
ident character varying,
|
||||
ident_type character varying,
|
||||
auth_info character varying NOT NULL,
|
||||
name character varying,
|
||||
name character varying NOT NULL,
|
||||
org_name character varying,
|
||||
registrar_id integer NOT NULL,
|
||||
creator_str character varying,
|
||||
|
@ -4280,6 +4280,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
|||
('20180613030330'),
|
||||
('20180613045614'),
|
||||
('20180713154915'),
|
||||
('20180801114403'),
|
||||
('20180808064402'),
|
||||
('20180816123540'),
|
||||
('20180823161237'),
|
||||
|
|
|
@ -18,8 +18,8 @@ class ContactVersionsTest < ApplicationSystemTestCase
|
|||
|
||||
def create_contact_with_history
|
||||
sql = <<-SQL.squish
|
||||
INSERT INTO contacts (id, code, email, auth_info, registrar_id)
|
||||
VALUES (75, 'test_code', 'test@inbox.test', '8b4d462aa04194ca78840a', #{@registrar.id});
|
||||
INSERT INTO contacts (id, name, code, email, auth_info, registrar_id)
|
||||
VALUES (75, 'test_name', 'test_code', 'test@inbox.test', '8b4d462aa04194ca78840a', #{@registrar.id});
|
||||
|
||||
INSERT INTO log_contacts (item_type, item_id, event, whodunnit, object,
|
||||
object_changes, created_at, session, children, ident_updated_at, uuid)
|
||||
|
|
|
@ -18,8 +18,8 @@ class DomainVersionsTest < ApplicationSystemTestCase
|
|||
|
||||
def create_domain_with_history
|
||||
sql = <<-SQL.squish
|
||||
INSERT INTO contacts (id, code, email, auth_info, registrar_id)
|
||||
VALUES (54, 'test_code', 'test@inbox.test', '8b4d462aa04194ca78840a', #{@registrar.id});
|
||||
INSERT INTO contacts (id, name, code, email, auth_info, registrar_id)
|
||||
VALUES (54, 'test_code', 'test_name', 'test@inbox.test', '8b4d462aa04194ca78840a', #{@registrar.id});
|
||||
|
||||
INSERT INTO domains (id, name, name_puny, name_dirty, registrar_id, valid_to, registrant_id,
|
||||
transfer_code)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue