forked from Pink-Book/Pinkbook-Source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tables.sql
70 lines (66 loc) · 1.57 KB
/
tables.sql
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--change name of table to notebook
CREATE TABLE public.notebook (
"_id" serial NOT NULL,
"name" varchar,
"description" varchar,
"date_created" varchar,
"page_number" integer,
"date_updated" varchar,
"shared_with" varchar,
PRIMARY KEY ("_id")
) WITH (
OIDS=FALSE
);
--created new notes table
CREATE TABLE public.notes (
"_id" serial NOT NULL,
"notebook_id" bigint,
"textbox" varchar,
"date_created" varchar,
"page_number" integer,
"date_updated" varchar,
"shared_with" varchar,
PRIMARY KEY ("_id"),
CONSTRAINT "fk_notebook"
FOREIGN KEY("notebook_id")
REFERENCES public.notebook("_id")
) WITH (
OIDS=FALSE
);
--created new skills table
CREATE TABLE public.skills (
"_id" serial NOT NULL,
"notebook_id" bigint,
"name" varchar,
"rating" integer,
PRIMARY KEY ("_id"),
CONSTRAINT "fk_notebook"
FOREIGN KEY("notebook_id")
REFERENCES public.notebook("_id")
) WITH (
OIDS=FALSE
);
--created new reminders table
CREATE TABLE public.reminders (
"_id" serial NOT NULL,
"notebook_id" bigint,
"description" varchar,
"date_created" varchar,
"time" varchar,
PRIMARY KEY ("_id"),
CONSTRAINT "fk_notebook"
FOREIGN KEY("notebook_id")
REFERENCES public.notebook("_id")
) WITH (
OIDS=FALSE
);