mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 09:27:19 +02:00
13 lines
296 B
Ruby
13 lines
296 B
Ruby
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
|