-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.sql
More file actions
68 lines (64 loc) · 2.6 KB
/
Copy pathscript.sql
File metadata and controls
68 lines (64 loc) · 2.6 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
59
60
61
62
63
64
65
66
67
68
CREATE TABLE IF NOT EXISTS public.event
(
id integer NOT NULL DEFAULT nextval('event_id_seq'::regclass),
description character varying COLLATE pg_catalog."default",
is_active boolean,
date_start timestamp without time zone,
expire_at timestamp without time zone,
last_modified_by character varying COLLATE pg_catalog."default",
last_modified timestamp without time zone,
created timestamp without time zone,
created_by character varying COLLATE pg_catalog."default",
CONSTRAINT event_pkey PRIMARY KEY (id)
)
CREATE TABLE IF NOT EXISTS public.event_user
(
id integer NOT NULL DEFAULT nextval('event_user_id_seq'::regclass),
fk_event integer,
fk_user_id character varying COLLATE pg_catalog."default",
created_by character varying COLLATE pg_catalog."default",
created timestamp without time zone,
last_modified_by character varying COLLATE pg_catalog."default",
last_modified timestamp without time zone,
CONSTRAINT event_user_pkey PRIMARY KEY (id)
)
CREATE TABLE IF NOT EXISTS public.quiz
(
id integer NOT NULL DEFAULT nextval('quiz_quiz_seq'::regclass),
hint character varying COLLATE pg_catalog."default",
question character varying COLLATE pg_catalog."default",
answer character varying COLLATE pg_catalog."default",
fk_event integer,
has_next_question boolean,
title character varying COLLATE pg_catalog."default",
created_by character varying COLLATE pg_catalog."default",
created timestamp without time zone,
last_modified_by character varying COLLATE pg_catalog."default",
last_modified timestamp without time zone,
CONSTRAINT quiz_pkey PRIMARY KEY (id),
CONSTRAINT quiz_fk_event_fkey FOREIGN KEY (fk_event)
REFERENCES public.event (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
)
CREATE TABLE IF NOT EXISTS public.reward
(
id integer NOT NULL DEFAULT nextval('reward_id_seq'::regclass),
coins integer,
expirience integer,
claimed boolean,
role character varying COLLATE pg_catalog."default",
participant_reward boolean,
fk_event integer,
created_by character varying COLLATE pg_catalog."default",
created timestamp without time zone,
last_modified_by character varying COLLATE pg_catalog."default",
last_modified timestamp without time zone,
CONSTRAINT reward_pkey PRIMARY KEY (id),
CONSTRAINT fk_event FOREIGN KEY (fk_event)
REFERENCES public.event (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
)