fix: sql config change to avoid null and set email to be unique
This commit is contained in:
parent
2066dc834e
commit
4b558dd4c3
8
init.sql
8
init.sql
@ -1,13 +1,13 @@
|
|||||||
CREATE TABLE IF NOT EXISTS users (
|
CREATE TABLE IF NOT EXISTS users (
|
||||||
id SERIAL PRIMARY KEY,
|
id SERIAL PRIMARY KEY,
|
||||||
email VARCHAR(255) UNIQUE NOT NULL,
|
email VARCHAR(255) NOT NULL UNIQUE,
|
||||||
hashed_password VARCHAR(255) NOT NULL,
|
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 (
|
CREATE TABLE IF NOT EXISTS otps (
|
||||||
id SERIAL PRIMARY KEY,
|
id SERIAL PRIMARY KEY,
|
||||||
email VARCHAR(255) NOT NULL,
|
email VARCHAR(255) NOT NULL UNIQUE,
|
||||||
otp VARCHAR(6) NOT NULL,
|
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
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user