diff --git a/postgres/schema.sql b/postgres/schema.sql index c62f208..aff6d20 100644 --- a/postgres/schema.sql +++ b/postgres/schema.sql @@ -131,7 +131,8 @@ CREATE TABLE nodes ( ); CREATE TABLE roles ( - email TEXT PRIMARY KEY, + -- email should always be lowercase since that's how the auth function compares it + email TEXT PRIMARY KEY CHECK email = lower(email), name TEXT NOT NULL, editor BOOLEAN NOT NULL DEFAULT FALSE, artist BOOLEAN NOT NULL DEFAULT FALSE