mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
AddInvoicesNumberUniqConstraint
This commit is contained in:
parent
18e6f511aa
commit
f1b37853b9
2 changed files with 23 additions and 0 deletions
|
@ -0,0 +1,13 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue