Skip to content

Commit

Permalink
Add 3 checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime H committed Jun 17, 2024
1 parent 3e4cb6d commit ca48276
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion services/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
lastName VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
is_admin BOOLEAN NOT NULL DEFAULT 0
is_admin BOOLEAN NOT NULL DEFAULT 0,
CHECK (LENGTH(firstName) >= 2),
CHECK (LENGTH(lastName) >= 2),
CHECK (email REGEXP '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$')
)");

$conn->exec("CREATE TABLE IF NOT EXISTS favorites (
Expand Down

0 comments on commit ca48276

Please sign in to comment.