You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is better to enforce it directly in the database
username VARCHAR(255) NOT NULL UNIQUE,
email VARCHAR(255) NOT NULL UNIQUE,
guarantees you won't be able to insert duplicate data (with the code you might introduce some new way of inserting users in the future and forget to enforce the uniqueness)
allows you to get rid of the initial DB search during signup and just insert right away - if duplicate records already exist, you will get an error
Probably no action necessary, just something to keep in mind.
The text was updated successfully, but these errors were encountered:
11janci
changed the title
Username and email columns unique
Username and email columns not unique
Oct 1, 2019
Currently in the database the username and email columns are not unique:
lang-mate/server/database/config/dbbuild.sql
Line 17 in bedbb9d
lang-mate/server/database/config/dbbuild.sql
Line 18 in bedbb9d
You are enforcing uniqueness in the code during signup by searching if the username or email already exist in the database:
lang-mate/server/controllers/auth/signup.js
Line 16 in bedbb9d
It is better to enforce it directly in the database
Probably no action necessary, just something to keep in mind.
The text was updated successfully, but these errors were encountered: