File size: 437 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13

-- +migrate Up

ALTER TABLE user_contact_methods ADD UNIQUE(name, type, user_id);
ALTER TABLE user_contact_methods ADD UNIQUE(type, value);
ALTER TABLE user_contact_methods ALTER id SET DEFAULT gen_random_uuid();

-- +migrate Down

ALTER TABLE user_contact_methods DROP CONSTRAINT UNIQUE(name, type, user_id);
ALTER TABLE user_contact_methods DROP CONSTRAINT UNIQUE(type, value);
ALTER TABLE user_contact_methods ALTER id DROP DEFAULT;