-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase_script.txt
More file actions
77 lines (63 loc) · 1.6 KB
/
database_script.txt
File metadata and controls
77 lines (63 loc) · 1.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
69
70
71
72
73
74
75
76
77
knex.insert({
first_name: firstName,
last_name: lastName,
email: email,
phone_number: phoneNumber
})
.returning('id')
.into('person')
.then(function (id) {
// use id here
});
CREATE TABLES:
create table users (
visit_id serial not null unique primary key,
header_info varchar(1200),
ip_info inet,
asn_prefix cidr,
as_name varchar(40),
start_time_stamp varchar(30),
end_time_stamp varchar(30),
start_time time with time zone,
end_time time with time zone,
start_date date,
end_date date
);
create table PageUrl (
id serial not null unique primary key,
page_url varchar(30) not null,
user_visit_id integer not null references users(visit_id)
);
create table MouseEvents (
id serial not null unique primary key,
x smallint,
y smallint,
height smallint,
width smallint,
time_at_point bigint,
user_visit_id integer not null references users(visit_id),
page_id integer not null references pageurl(id)
);
create table KeyBoardEvents (
id serial not null unique primary key,
key_pressed varchar(12),
dwellTime integer,
flightTime integer,
user_visit_id integer not null references users(visit_id),
page_id integer not null references pageurl(id)
);
create table ClickEvents (
id serial not null unique primary key,
x smallint,
y smallint,
height smallint,
width smallint,
user_visit_id integer not null references users(visit_id),
page_id integer not null references pageurl(id)
);
DELETE TABLES:
DROP table clickevents;
drop table keyboardevents;
drop table mouseevents;
drop table pageurl;
drop table users;