-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathqueries.sql
More file actions
25 lines (22 loc) · 801 Bytes
/
queries.sql
File metadata and controls
25 lines (22 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- Active: 1674084192186@@35.226.146.116@3306@jbl-4416152-caroline-martins
CREATE TABLE IF NOT EXISTS Cookenu_users(
id VARCHAR(255) PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(64) NOT NULL UNIQUE,
password VARCHAR(64) NOT NULL
);
CREATE TABLE IF NOT EXISTS Cookenu_recipe(
id VARCHAR(255) PRIMARY KEY,
title VARCHAR(255) NOT NULL,
description TEXT NOT NULL,
creation_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
id_author VARCHAR(255) NOT NULL,
FOREIGN KEY (id_author) REFERENCES Cookenu_users (id)
);
CREATE Table IF NOT EXISTS Cookenu_follow(
id VARCHAR(255) PRIMARY KEY,
user_id VARCHAR(255),
follow_id VARCHAR(255) ,
FOREIGN KEY (user_id) REFERENCES Cookenu_users(id),
FOREIGN KEY (follow_id) REFERENCES Cookenu_users(id)
);