mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
bcdade7d8c
Username length and format, via regex, are already enforced at the application layer, but we have some code paths with database queries where we could optimize away many of the DB query calls if we could be sure at the database level that the username is never an empty string. For example: https://github.com/coder/coder/pull/19395 --------- Signed-off-by: Callum Styan <callumstyan@gmail.com>
4 lines
90 B
SQL
4 lines
90 B
SQL
ALTER TABLE users
|
|
ADD CONSTRAINT users_username_min_length
|
|
CHECK (length(username) >= 1);
|