mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
Add contacts.uuid
and domains.uuid
uniq constraints
This commit is contained in:
parent
5626c87e04
commit
183eca884e
2 changed files with 33 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
||||||
|
class AddContactsAndDomainsUuidUniqConstraint < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
execute <<-SQL
|
||||||
|
ALTER TABLE contacts ADD CONSTRAINT uniq_contact_uuid UNIQUE (uuid);
|
||||||
|
ALTER TABLE domains ADD CONSTRAINT uniq_domain_uuid UNIQUE (uuid);
|
||||||
|
SQL
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
execute <<-SQL
|
||||||
|
ALTER TABLE contacts DROP CONSTRAINT uniq_contact_uuid;
|
||||||
|
ALTER TABLE domains DROP CONSTRAINT uniq_domain_uuid;
|
||||||
|
SQL
|
||||||
|
end
|
||||||
|
end
|
|
@ -3258,6 +3258,22 @@ ALTER TABLE ONLY settings
|
||||||
ADD CONSTRAINT settings_pkey PRIMARY KEY (id);
|
ADD CONSTRAINT settings_pkey PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: uniq_contact_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY contacts
|
||||||
|
ADD CONSTRAINT uniq_contact_uuid UNIQUE (uuid);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: uniq_domain_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY domains
|
||||||
|
ADD CONSTRAINT uniq_domain_uuid UNIQUE (uuid);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: unique_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
-- Name: unique_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||||
--
|
--
|
||||||
|
@ -4740,3 +4756,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180612042953');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20180613030330');
|
INSERT INTO schema_migrations (version) VALUES ('20180613030330');
|
||||||
|
|
||||||
|
INSERT INTO schema_migrations (version) VALUES ('20180613045614');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue