mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 16:53:37 +02:00
Add contacts.code
constraints
This commit is contained in:
parent
46f11155cb
commit
76782c72e3
3 changed files with 31 additions and 1 deletions
|
@ -0,0 +1,13 @@
|
|||
class AddUniqueConstraintToContactsCode < ActiveRecord::Migration
|
||||
def up
|
||||
execute <<-SQL
|
||||
ALTER TABLE contacts ADD CONSTRAINT unique_contact_code UNIQUE (code)
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<-SQL
|
||||
ALTER TABLE contacts DROP CONSTRAINT unique_contact_code
|
||||
SQL
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue