- users
CREATE TABLE users(
id SERIAL PRIMARY KEY,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
companyname VARCHAR(20) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(500) NOT NULL,
name VARCHAR(40) NOT NULL,
);
- reviews
CREATE TABLE reviews(
id SERIAL PRIMARY KEY,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
content VARCHAR(500),
rating smallint
);