This repository was archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathdb_postgres.sql
More file actions
58 lines (48 loc) · 1.24 KB
/
db_postgres.sql
File metadata and controls
58 lines (48 loc) · 1.24 KB
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
--
-- Table structure for table "follow"
--
CREATE TABLE "follow" (
"id" SERIAL PRIMARY KEY,
"userId" BIGINT NOT NULL,
"userName" varchar(100) NOT NULL,
"status" text,
"followDate" TIMESTAMP WITH TIME ZONE NOT NULL,
"unfollowDate" TIMESTAMP WITH TIME ZONE DEFAULT NULL,
"lastAction" TIMESTAMP WITH TIME ZONE NOT NULL
);
CREATE INDEX ON "follow" ("userId");
--
-- Table structure for table "tweet"
--
CREATE TABLE "tweet" (
"id" SERIAL PRIMARY KEY,
"content" text NOT NULL,
"date" TIMESTAMP WITH TIME ZONE NOT NULL
);
CREATE INDEX ON "tweet" ("content");
--
-- Table structure for table "reply"
--
CREATE TABLE "reply" (
"id" SERIAL PRIMARY KEY,
"userId" BIGINT NOT NULL,
"userName" VARCHAR(100) NOT NULL,
"tweetId" BIGINT NOT NULL,
"status" TEXT NOT NULL,
"answer" TEXT NOT NULL,
"replyDate" TIMESTAMP WITH TIME ZONE NOT NULL
);
CREATE INDEX ON "reply" ("tweetId");
--
-- Table structure for table "favorite"
--
CREATE TABLE "favorite" (
"id" SERIAL PRIMARY KEY,
"userId" BIGINT NOT NULL,
"userName" VARCHAR(100) NOT NULL,
"tweetId" BIGINT NOT NULL,
"status" TEXT NOT NULL,
"favDate" TIMESTAMP WITH TIME ZONE NOT NULL,
"unfavDate" TIMESTAMP WITH TIME ZONE NULL,
"lastAction" TIMESTAMP WITH TIME ZONE NOT NULL
);