-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_tables.sql
65 lines (58 loc) · 1.21 KB
/
create_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
58
59
60
61
62
63
64
create table establishments(
id int unsigned not null auto_increment,
name varchar(100),
lat float,
lon float,
address varchar(100),
primary key(id)
);
create table beers(
id int unsigned not null auto_increment,
name varchar(100),
brewery varchar(100),
ibu smallint unsigned,
abv float,
limited_release bool,
description text,
rate_beer_id varchar(64),
primary key(id)
);
create table likes(
id int unsigned not null auto_increment,
device_guid varchar(255),
beer_id int unsigned,
age tinyint unsigned,
like_type tinyint unsigned,
primary key(id)
);
create table statuses(
id int unsigned not null auto_increment,
establishment_id int unsigned,
beer_id int unsigned,
status tinyint unsigned,
report_countdown int unsigned,
reported_out_count int unsigned,
last_out_update datetime,
primary key(id)
);
create table reportstate(
device_guid varchar(255),
establishment_id int unsigned,
beer_id int unsigned,
report_count int unsigned,
last_report_update datetime
);
create table usertoken(
username varchar(255),
email varchar(255),
token varchar(255)
);
create table futuredata(
id int unsigned not null auto_increment,
lat float,
lon float,
device_guid varchar(255),
beer_id int unsigned,
age int unsigned,
primary key(id)
);