mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 13:44:47 +02:00
13 lines
284 B
Ruby
13 lines
284 B
Ruby
class AddInvoicesNumberUniqConstraint < ActiveRecord::Migration
|
|
def up
|
|
execute <<-SQL
|
|
ALTER TABLE invoices ADD CONSTRAINT unique_number UNIQUE (number)
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
execute <<-SQL
|
|
ALTER TABLE invoices DROP CONSTRAINT unique_number
|
|
SQL
|
|
end
|
|
end
|