mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 20:27:30 +02:00
13 lines
301 B
Ruby
13 lines
301 B
Ruby
class AddUniqueConstraintToContactsCode < ActiveRecord::Migration[6.0]
|
|
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
|