-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadsy.sql
More file actions
37 lines (28 loc) · 950 Bytes
/
readsy.sql
File metadata and controls
37 lines (28 loc) · 950 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
25
26
27
28
29
30
31
32
-- This script only contains the table creation statements and does not fully represent the table in the database. Do not use it as a backup.
-- Sequence and defined type
CREATE SEQUENCE IF NOT EXISTS users_id_seq;
-- Table Definition
CREATE TABLE "public"."users" (
"id" int4 NOT NULL DEFAULT nextval('users_id_seq'::regclass),
"email" varchar(100) NOT NULL,
"password" varchar(100) NOT NULL,
PRIMARY KEY ("id")
);
-- Sequence and defined type
CREATE SEQUENCE IF NOT EXISTS books_id_seq;
-- Table Definition
CREATE TABLE "public"."books" (
"id" int4 NOT NULL DEFAULT nextval('books_id_seq'::regclass),
"isbn" varchar(15),
"title" text,
"author" text,
"genre" text,
"img_url" text,
"date_read" date,
"rating" int4,
"review" text,
"notes" text,
"user_id" int4,
CONSTRAINT "books_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id"),
PRIMARY KEY ("id")
);