Let Postgres generate constraint names
Postgres can automatically generate constraint names if you omit the word constraint:
alter table users
add foreign key (location_id) references locations;
alter table users
add unique (email);
Tweet