-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstructure.sql
231 lines (208 loc) · 5.76 KB
/
structure.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 17, 2019 at 03:44 AM
-- Server version: 5.7.18-0ubuntu0.16.04.1
-- PHP Version: 7.0.18-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `fit`
--
CREATE DATABASE IF NOT EXISTS `fit` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `fit`;
-- --------------------------------------------------------
--
-- Table structure for table `activity`
--
CREATE TABLE IF NOT EXISTS `activity` (
`username` varchar(255) NOT NULL,
`day` varchar(255) NOT NULL,
`activity_type` int(11) NOT NULL,
`length_ms` int(11) NOT NULL,
`n_segments` int(11) NOT NULL,
`lastUpdated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`username`,`day`,`activity_type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `activity_goals`
--
CREATE TABLE IF NOT EXISTS `activity_goals` (
`username` varchar(255) NOT NULL,
`minutes` int(11) NOT NULL,
`lastModified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `activity_types`
--
CREATE TABLE IF NOT EXISTS `activity_types` (
`name` varchar(255) NOT NULL,
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Truncate table before insert `activity_types`
--
TRUNCATE TABLE `activity_types`;
--
-- Dumping data for table `activity_types`
--
INSERT INTO `activity_types` (`name`, `id`) VALUES
('In vehicle*', 0),
('Biking*', 1),
('On foot*', 2),
('Still (not moving)*', 3),
('Unknown (unable to detect activity)*', 4),
('Tilting (sudden device gravity change)*', 5),
('Walking*', 7),
('Running*', 8),
('Aerobics', 9),
('Badminton', 10),
('Baseball', 11),
('Basketball', 12),
('Biathlon', 13),
('Handbiking', 14),
('Mountain biking', 15),
('Road biking', 16),
('Spinning', 17),
('Stationary biking', 18),
('Utility biking', 19),
('Boxing', 20),
('Calisthenics', 21),
('Circuit training', 22),
('Cricket', 23),
('Dancing', 24),
('Elliptical', 25),
('Fencing', 26),
('Football (American)', 27),
('Football (Australian)', 28),
('Football (Soccer)', 29),
('Frisbee', 30),
('Gardening', 31),
('Golf', 32),
('Gymnastics', 33),
('Handball', 34),
('Hiking', 35),
('Hockey', 36),
('Horseback riding', 37),
('Housework', 38),
('Jumping rope', 39),
('Kayaking', 40),
('Kettlebell training', 41),
('Kickboxing', 42),
('Kitesurfing', 43),
('Martial arts', 44),
('Meditation', 45),
('Mixed martial arts', 46),
('P90X exercises', 47),
('Paragliding', 48),
('Pilates', 49),
('Polo', 50),
('Racquetball', 51),
('Rock climbing', 52),
('Rowing', 53),
('Rowing machine', 54),
('Rugby', 55),
('Jogging', 56),
('Running on sand', 57),
('Running (treadmill)', 58),
('Sailing', 59),
('Scuba diving', 60),
('Skateboarding', 61),
('Skating', 62),
('Cross skating', 63),
('Inline skating (rollerblading)', 64),
('Skiing', 65),
('Back-country skiing', 66),
('Cross-country skiing', 67),
('Downhill skiing', 68),
('Kite skiing', 69),
('Roller skiing', 70),
('Sledding', 71),
('Sleeping', 72),
('Snowboarding', 73),
('Snowmobile', 74),
('Snowshoeing', 75),
('Squash', 76),
('Stair climbing', 77),
('Stair-climbing machine', 78),
('Stand-up paddleboarding', 79),
('Strength training', 80),
('Surfing', 81),
('Swimming', 82),
('Swimming (swimming pool)', 83),
('Swimming (open water)', 84),
('Table tennis (ping pong)', 85),
('Team sports', 86),
('Tennis', 87),
('Treadmill (walking or running)', 88),
('Volleyball', 89),
('Volleyball (beach)', 90),
('Volleyball (indoor)', 91),
('Wakeboarding', 92),
('Walking (fitness)', 93),
('Nording walking', 94),
('Walking (treadmill)', 95),
('Waterpolo', 96),
('Weightlifting', 97),
('Wheelchair', 98),
('Windsurfing', 99),
('Yoga', 100),
('Zumba', 101),
('Diving', 102),
('Ergometer', 103),
('Ice skating', 104),
('Indoor skating', 105),
('Curling', 106),
('Other (unclassified fitness activity)', 108),
('Light sleep', 109),
('Deep sleep', 110),
('REM sleep', 111),
('Awake (during sleep cycle)', 112),
('Crossfit', 113),
('HIIT', 114),
('Interval Training', 115),
('Walking (stroller)', 116),
('Elevator', 117),
('Escalator', 118),
('Archery', 119),
('Softball', 120);
-- --------------------------------------------------------
--
-- Table structure for table `google_fit`
--
CREATE TABLE IF NOT EXISTS `google_fit` (
`username` varchar(255) NOT NULL,
`google_id` varchar(255) NOT NULL,
`full_name` varchar(255) NOT NULL,
`gender` varchar(255) DEFAULT NULL,
`image_url` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`refresh_token` varchar(255) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`google_id`),
KEY `google_id` (`google_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `steps`
--
CREATE TABLE IF NOT EXISTS `steps` (
`username` varchar(255) NOT NULL,
`day` varchar(255) NOT NULL,
`steps` int(11) NOT NULL,
`lastUpdated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`username`,`day`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;