0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00

Exclude from unique index users marked for delete.

This commit is contained in:
Andrey Antukh 2017-01-22 17:00:56 +01:00
parent 2ba3d27db6
commit 1efd25a0e5
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -24,10 +24,12 @@ VALUES ('00000000-0000-0000-0000-000000000000'::uuid,
''::bytea);
CREATE UNIQUE INDEX users_username_idx
ON users USING btree (username);
ON users WHERE deleted_at is null
USING btree (username) ;
CREATE UNIQUE INDEX users_email_idx
ON users USING btree (email);
ON users WHERE deleted_at is null
USING btree (email);
CREATE TRIGGER users_modified_at_tgr BEFORE UPDATE ON users
FOR EACH ROW EXECUTE PROCEDURE update_modified_at();