fix: sql config change to avoid null and set email to be unique

This commit is contained in:
dhanush.s 2025-09-08 09:04:04 +05:30
parent 2066dc834e
commit 4b558dd4c3

View File

@ -1,13 +1,13 @@
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
hashed_password VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS otps (
id SERIAL PRIMARY KEY,
email VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
otp VARCHAR(6) NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP
);