-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdatabase.sql
More file actions
80 lines (69 loc) · 1.63 KB
/
database.sql
File metadata and controls
80 lines (69 loc) · 1.63 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
69
70
71
72
73
74
75
76
77
78
79
-- database name: neurosity
CREATE TABLE eegproc (
id SERIAL PRIMARY KEY UNIQUE,
task text,
acquired text,
reactivityprofile text,
reactivityscore text,
session_id integer REFERENCES session(id)
);
CREATE TABLE eegraw (
id SERIAL PRIMARY KEY,
task text,
acquired text,
run text,
json text,
session_id integer REFERENCES session(id)
);
CREATE TABLE participant (
id SERIAL PRIMARY KEY,
name text,
gender text,
birthdate text,
height text,
weight integer,
group_id integer REFERENCES researchgroup(id),
disabled boolean DEFAULT false
);
CREATE TABLE pins (
id SERIAL PRIMARY KEY,
pin_number integer,
group_id integer REFERENCES researchgroup(id)
);
CREATE TABLE researchgroup (
id SERIAL PRIMARY KEY,
name text,
description text
);
CREATE TABLE session (
id SERIAL PRIMARY KEY,
time timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
notes text,
user_id integer REFERENCES users(id),
participant_id integer REFERENCES participant(id),
group_id integer REFERENCES researchgroup(id)
);
CREATE TABLE surveyproc (
id SERIAL PRIMARY KEY,
cravingscore text,
depressionscore text,
anxietyscore text,
usestatus text,
session_id integer REFERENCES session(id)
);
CREATE TABLE surveyraw (
id SERIAL PRIMARY KEY,
variant text,
json text,
session_id integer REFERENCES session(id),
csvlocation text
);
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email text,
name text,
password text,
role text,
group_id integer REFERENCES researchgroup(id),
disabled boolean DEFAULT false
);