Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 9f498fb

Browse files
committed
Add SQL constraint to ensure unicity of emails
1 parent 1c348f0 commit 9f498fb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
DO $$
2+
BEGIN
3+
BEGIN
4+
CREATE UNIQUE INDEX sys_user_unique_email ON sys_user(email) WHERE email != '';
5+
END;
6+
BEGIN
7+
CREATE UNIQUE INDEX cd_profiles_unique_email ON cd_profiles(email) WHERE email != '';
8+
END;
9+
END;
10+
$$

0 commit comments

Comments
 (0)