Add contacts.code constraints

This commit is contained in:
Artur Beljajev 2018-01-26 12:52:58 +02:00
parent 46f11155cb
commit 76782c72e3
3 changed files with 31 additions and 1 deletions

View file

@ -644,7 +644,7 @@ ALTER SEQUENCE contact_statuses_id_seq OWNED BY contact_statuses.id;
CREATE TABLE contacts (
id integer NOT NULL,
code character varying,
code character varying NOT NULL,
phone character varying,
email character varying,
fax character varying,
@ -3627,6 +3627,14 @@ ALTER TABLE ONLY settings
ADD CONSTRAINT settings_pkey PRIMARY KEY (id);
--
-- Name: unique_contact_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY contacts
ADD CONSTRAINT unique_contact_code UNIQUE (code);
--
-- Name: unique_zone_origin; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
@ -5068,3 +5076,7 @@ INSERT INTO schema_migrations (version) VALUES ('20180123170112');
INSERT INTO schema_migrations (version) VALUES ('20180125092422');
INSERT INTO schema_migrations (version) VALUES ('20180126104536');
INSERT INTO schema_migrations (version) VALUES ('20180126104903');