mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Add database constraints
This commit is contained in:
parent
840f1db5c9
commit
ba33f5740e
10 changed files with 345 additions and 225 deletions
|
@ -0,0 +1,13 @@
|
|||
class AddBlockedDomainsNameUniqConstraint < ActiveRecord::Migration
|
||||
def up
|
||||
execute <<-SQL
|
||||
ALTER TABLE blocked_domains ADD CONSTRAINT uniq_blocked_domains_name UNIQUE (name);
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<-SQL
|
||||
ALTER TABLE blocked_domains DROP CONSTRAINT uniq_blocked_domains_name;
|
||||
SQL
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue