-
Notifications
You must be signed in to change notification settings - Fork 0
/
initial.sql
62 lines (53 loc) · 1.28 KB
/
initial.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
CREATE TABLE "t_miniverses" (
"name" text,
"summary" text,
"date" timestamptz,
"follower_count" bigint DEFAULT 0,
"follower_names" text [],
"creator" text,
"moderators" text [],
"encoded_uri" text,
"miniverse_type" text
);
CREATE TABLE "t_replies" (
"reply_content" text,
"creator" text,
"creation_date" timestamptz,
"miniverse" text,
"reply_id" bigint,
"topic_id" bigint
);
CREATE TABLE "t_topics" (
"title" text,
"descriptor" text,
"creator" text,
"miniverse" text,
"creation_date" timestamptz,
"topic_id" bigint
);
CREATE TABLE "t_users" (
"username" text,
"password_hash" text,
"date_created" timestamptz,
"ip_address" text,
"profile_data" text,
"following_names" text [],
"follower_names" text [],
"follower_count" bigint,
"bio" text DEFAULT('no bio'),
"role" text DEFAULT('user')
);
CREATE TABLE "t_profile_posts" (
"username" text,
"date_created" timestamptz,
"profile_post_content" text,
"post_id" bigint
);
CREATE TABLE "session" (
"sid" varchar NOT NULL COLLATE "default",
"sess" json NOT NULL,
"expire" timestamp(6) NOT NULL
)
WITH (OIDS=FALSE);
ALTER TABLE "session" ADD CONSTRAINT "session_pkey" PRIMARY KEY ("sid") NOT DEFERRABLE INITIALLY IMMEDIATE;
CREATE INDEX "IDX_session_expire" ON "session" ("expire");