mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +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
|
Loading…
Add table
Add a link
Reference in a new issue