-
Notifications
You must be signed in to change notification settings - Fork 0
/
tables.sql
57 lines (53 loc) · 1.44 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
CREATE TABLE IF NOT EXISTS agree(
id SERIAL PRIMARY KEY,
user_id UUID NOT NULL,
ip_hash VARCHAR NOT NULL,
proposal_id INT NOT NULL,
agree INT NOT NULL,
universe INT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
score DECIMAL NOT NULL,
locale VARCHAR NOT NULL,
option VARCHAR
);
CREATE TABLE IF NOT EXISTS consent(
id SERIAL PRIMARY KEY,
user_id UUID NOT NULL,
ip_hash VARCHAR NOT NULL,
universe INT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
locale VARCHAR NOT NULL
);
CREATE TABLE IF NOT EXISTS rank(
id SERIAL PRIMARY KEY,
user_id UUID NOT NULL,
ip_hash VARCHAR NOT NULL,
rank VARCHAR NOT NULL,
updated INT NOT NULL,
universe INT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
score DECIMAL NOT NULL,
locale VARCHAR NOT NULL
);
CREATE TABLE IF NOT EXISTS participant(
id SERIAL PRIMARY KEY,
user_id UUID NOT NULL,
ip_hash VARCHAR NOT NULL,
politics_id INT NOT NULL,
location_id VARCHAR NOT NULL,
age_id INT NOT NULL,
sex_id VARCHAR NOT NULL,
zone_id INT NOT NULL,
education_id INT NOT NULL,
universe INT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
score DECIMAL NOT NULL,
locale VARCHAR NOT NULL
);
CREATE TABLE IF NOT EXISTS access_log(
id SERIAL PRIMARY KEY,
user_id UUID,
ip_hash VARCHAR,
universe INT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);