Updated database schema file.

Commit
aad8d045ddd5f19889873cf0d334d74793b599f9
Author
Marius Peter <marius.peter@tutanota.com>
Author date
Committer
Marius Peter <marius.peter@tutanota.com>
Committer date
Changed files
create-mft-db.sql
index e62b6c3c..00000000 100644..000000
@@ -1,210 +0,0 @@
1 Removed: -- -*- mode: sql; -*-
2 Removed:
3 Removed: CREATE TABLE "Exercises" (
4 Removed: "id" INTEGER NOT NULL UNIQUE,
5 Removed: "english_name" INTEGER,
6 Removed: "description" TEXT,
7 Removed: "primary_muscle_id" INTEGER NOT NULL,
8 Removed: PRIMARY KEY("id" AUTOINCREMENT)
9 Removed: );
10 Removed:
11 Removed: CREATE TABLE "Prospects" (
12 Removed: "id" INTEGER UNIQUE,
13 Removed: "email" TEXT NOT NULL,
14 Removed: "date_time" TEXT NOT NULL,
15 Removed: PRIMARY KEY("id" AUTOINCREMENT)
16 Removed: );
17 Removed:
18 Removed: CREATE TABLE "Users" (
19 Removed: "id" INTEGER UNIQUE,
20 Removed: "username" TEXT NOT NULL,
21 Removed: "password_hash" BLOB NOT NULL,
22 Removed: "real_first_name" TEXT,
23 Removed: "real_last_name" TEXT,
24 Removed: "date_of_birth" TEXT,
25 Removed: "last_login_date_time" TEXT,
26 Removed: "account_register_date_time" TEXT,
27 Removed: PRIMARY KEY("id" AUTOINCREMENT)
28 Removed: );
29 Removed:
30 Removed: CREATE TABLE "Weights" (
31 Removed: "id" INTEGER UNIQUE,
32 Removed: "user_id" INTEGER NOT NULL,
33 Removed: "date" TEXT NOT NULL,
34 Removed: "value" NUMERIC NOT NULL,
35 Removed: PRIMARY KEY("id" AUTOINCREMENT)
36 Removed: );
37 Removed:
38 Removed: CREATE TABLE "Workouts" (
39 Removed: "id" INTEGER UNIQUE,
40 Removed: "user_id" INTEGER NOT NULL,
41 Removed: "date" TEXT NOT NULL,
42 Removed: "primary_muscle" TEXT,
43 Removed: "secondary_muscles" TEXT,
44 Removed: PRIMARY KEY("id" AUTOINCREMENT)
45 Removed: );
46 Removed:
47 Removed: CREATE TABLE "Muscle_Groups" (
48 Removed: "id" INTEGER NOT NULL UNIQUE,
49 Removed: "english_name" TEXT NOT NULL UNIQUE,
50 Removed: "french_name" TEXT NOT NULL UNIQUE,
51 Removed: "description" TEXT,
52 Removed: PRIMARY KEY("id" AUTOINCREMENT)
53 Removed: );
54 Removed:
55 Removed: INSERT INTO Muscle_Groups ("id", "english_name", "french_name", "description") VALUES
56 Removed: -- Upper body
57 Removed: ('1', 'neck', 'cou', NULL),
58 Removed: ('2', 'upper back', 'dos supérieur', NULL),
59 Removed: ('3', 'shoulder', 'épaule', NULL),
60 Removed: ('4', 'chest', 'torse', NULL),
61 Removed: ('5', 'triceps', 'triceps', NULL),
62 Removed: ('6', 'biceps', 'biceps', NULL),
63 Removed: ('7', 'forearm', 'avant-bras', NULL),
64 Removed: -- Core
65 Removed: ('8', 'abdominals', 'abdominaux', NULL),
66 Removed: ('9', 'lower back', 'dos inférieur', NULL),
67 Removed: ('10', 'hip', 'hanche', NULL),
68 Removed: ('11', 'glutes', 'fessier', NULL),
69 Removed: -- Lower body
70 Removed: ('12', 'quad', 'quadriceps', 'extends the knee'),
71 Removed: ('13', 'hamstring', 'ischio-jambier', 'flexes the knee and extends the hip'),
72 Removed: ('14', 'calf', 'mollet', NULL);
73 Removed:
74 Removed: CREATE TABLE "Muscles" (
75 Removed: "id" INTEGER NOT NULL UNIQUE,
76 Removed: "latin_name" TEXT NOT NULL UNIQUE,
77 Removed: "muscle_group_id" INTEGER NOT NULL,
78 Removed: "english_name" TEXT,
79 Removed: "function" TEXT,
80 Removed: FOREIGN KEY("muscle_group_id") REFERENCES Muscle_Groups("id"),
81 Removed: PRIMARY KEY("id" AUTOINCREMENT)
82 Removed: );
83 Removed:
84 Removed: INSERT INTO Muscles ("latin_name", "muscle_group_id", "english_name", "function") VALUES
85 Removed: -- Upper body
86 Removed: ('latissimus dorsi',
87 Removed: '2',
88 Removed: 'lats',
89 Removed: 'adducts and extends the shoulder'),
90 Removed: ('trapezius',
91 Removed: '2',
92 Removed: 'trap',
93 Removed: 'assists in moving and stabilizing the shoulder blades'),
94 Removed: ('deltoideus',
95 Removed: '3',
96 Removed: 'delts',
97 Removed: NULL),
98 Removed: ('pectoralis major',
99 Removed: '4',
100 Removed: 'pecs',
101 Removed: 'performs shoulder flexion and adduction'),
102 Removed: ('pectorali minor',
103 Removed: '4',
104 Removed: 'pectoral',
105 Removed: 'plays a role in stabilizing the shoulder blade and assists in deep breathing'),
106 Removed: ('triceps brachii',
107 Removed: '5',
108 Removed: 'triceps',
109 Removed: NULL),
110 Removed: ('biceps brachii',
111 Removed: '6',
112 Removed: 'biceps',
113 Removed: NULL),
114 Removed: ('extensor carpi radialias brevis',
115 Removed: '7',
116 Removed: NULL,
117 Removed: 'Responsible for extending the wrist and abducting the hand'),
118 Removed: ('brachio radialis',
119 Removed: '7',
120 Removed: NULL,
121 Removed: 'Responsible for flexing the forearm at the elbow joint'),
122 Removed: ('flexor carpi radialis',
123 Removed: '7',
124 Removed: NULL,
125 Removed: 'Responsible for flexing the wrist and abducting the hand'),
126 Removed: ('extensor carpi ulnaris',
127 Removed: '7',
128 Removed: NULL,
129 Removed: 'Responsible for extending the wrist and adducting the hand'),
130 Removed: ('flexor carpi ulnaris',
131 Removed: '7',
132 Removed: NULL,
133 Removed: 'Responsible for flexing the wrist and adducting the hand'),
134 Removed: ('extensor carpi radialis longus',
135 Removed: '7',
136 Removed: NULL,
137 Removed: 'Responsible for extending the wrist and abducting the hand'),
138 Removed:
139 Removed: -- Core
140 Removed: ('abdominalis',
141 Removed: '8',
142 Removed: 'abs',
143 Removed: 'wraps around the spine for protection and stability'),
144 Removed: ('obliquus externus abdominis',
145 Removed: '8',
146 Removed: 'external oblique',
147 Removed: NULL),
148 Removed: ('rectus abdominis',
149 Removed: '8',
150 Removed: 'six-pack',
151 Removed: NULL),
152 Removed: ('obliquus internus abdominis',
153 Removed: '8',
154 Removed: 'internal oblique',
155 Removed: 'Located on the front and side of the abdomen'),
156 Removed: ('erector spinae',
157 Removed: '9',
158 Removed: 'erectors',
159 Removed: 'extends the vertebral column and ensures maintaining an upright posture'),
160 Removed: ('gluteus maximus',
161 Removed: '11',
162 Removed: NULL,
163 Removed: 'performs hip extension, outward rotation, and abduction'),
164 Removed: ('gluteus medius',
165 Removed: '11',
166 Removed: NULL,
167 Removed: 'plays a role in hip abduction and medial rotation'),
168 Removed: ('gluteus minimus',
169 Removed: '11',
170 Removed: NULL,
171 Removed: 'assists in hip abduction and medial rotation, works with the gluteus medius'),
172 Removed:
173 Removed: -- Lower body
174 Removed: ('quadriceps femoris',
175 Removed: '12',
176 Removed: 'quad',
177 Removed: NULL),
178 Removed: ('biceps femoris',
179 Removed: '13',
180 Removed: 'hamstrings',
181 Removed: NULL),
182 Removed: ('semitendinosus',
183 Removed: '13',
184 Removed: 'hamstrings',
185 Removed: NULL),
186 Removed: ('semimembranosus',
187 Removed: '13',
188 Removed: 'hamstrings',
189 Removed: NULL),
190 Removed: ('gastrocnemius',
191 Removed: '14',
192 Removed: NULL, 'performs plantar flexion of the foot (pointing toes)'),
193 Removed: ('soleus',
194 Removed: '14',
195 Removed: NULL, 'assists the gastrocnemius in plantar flexion and helps maintain posture');
196 Removed:
197 Removed: CREATE TABLE "Reps" (
198 Removed: "id" INTEGER NOT NULL UNIQUE,
199 Removed: "set_group" INTEGER NOT NULL,
200 Removed: "set" INTEGER NOT NULL,
201 Removed: "amount" INTEGER NOT NULL,
202 Removed: "load" INTEGER,
203 Removed: "rpe" INTEGER,
204 Removed: "rest_after_s" NUMERIC,
205 Removed: PRIMARY KEY("id" AUTOINCREMENT)
206 Removed: );
207 Removed:
208 Removed: -- Local Variables:
209 Removed: -- sql-product: sqlite
210 Removed: -- End:
mft-schema.sql
index 00000000..97e7f75a 000000..100644
@@ -0,0 +1,279 @@
1 Added: -- -*- mode: sql; -*-
2 Added:
3 Added: CREATE TABLE "Prospects" (
4 Added: "id" INTEGER UNIQUE,
5 Added: "email" TEXT NOT NULL,
6 Added: "date_time" TEXT NOT NULL,
7 Added: PRIMARY KEY("id" AUTOINCREMENT)
8 Added: );
9 Added:
10 Added: CREATE TABLE "Users" (
11 Added: "id" INTEGER UNIQUE,
12 Added: "username" TEXT NOT NULL,
13 Added: "password_hash" BLOB NOT NULL,
14 Added: "real_first_name" TEXT,
15 Added: "real_last_name" TEXT,
16 Added: "date_of_birth" TEXT,
17 Added: "last_login_date_time" TEXT,
18 Added: "account_register_date_time" TEXT,
19 Added: PRIMARY KEY("id" AUTOINCREMENT)
20 Added: );
21 Added:
22 Added: INSERT INTO Users VALUES (
23 Added: '1',
24 Added: 'testMFT',
25 Added: 'testMFTUserNeedsNoPassword!',
26 Added: 'Testimothy',
27 Added: 'McTestington',
28 Added: '1996-06-14',
29 Added: '2024-05-09T14:34:12',
30 Added: '2024-05-09T14:31:12'
31 Added: );
32 Added:
33 Added: CREATE TABLE "Muscle_Groups" (
34 Added: "id" INTEGER NOT NULL UNIQUE,
35 Added: "english_name" TEXT NOT NULL UNIQUE,
36 Added: "french_name" TEXT NOT NULL UNIQUE,
37 Added: "function" TEXT,
38 Added: PRIMARY KEY("id" AUTOINCREMENT)
39 Added: );
40 Added:
41 Added: -- Upper body
42 Added: INSERT INTO Muscle_Groups ("id", "english_name", "french_name", "function") VALUES
43 Added: ('1', 'neck', 'cou', NULL),
44 Added: ('2', 'upper back', 'dos supérieur', NULL),
45 Added: ('3', 'shoulder', 'épaule', NULL),
46 Added: ('4', 'chest', 'torse', NULL),
47 Added: ('5', 'triceps', 'triceps', NULL),
48 Added: ('6', 'biceps', 'biceps', NULL),
49 Added: ('7', 'forearm', 'avant-bras', NULL);
50 Added:
51 Added: -- Core
52 Added: INSERT INTO Muscle_Groups ("id", "english_name", "french_name", "function") VALUES
53 Added: ('8', 'abdominals', 'abdominaux', NULL),
54 Added: ('9', 'lower back', 'dos inférieur', NULL),
55 Added: ('10', 'hip', 'hanche', NULL),
56 Added: ('11', 'glutes', 'fessier', NULL);
57 Added:
58 Added: -- Lower body
59 Added: INSERT INTO Muscle_Groups ("id", "english_name", "french_name", "function") VALUES
60 Added: ('12', 'quad', 'quadriceps', 'extends the knee'),
61 Added: ('13', 'hamstring', 'ischio-jambier', 'flexes the knee and extends the hip'),
62 Added: ('14', 'calf', 'mollet', NULL);
63 Added:
64 Added: CREATE TABLE "Muscles" (
65 Added: "id" INTEGER NOT NULL UNIQUE,
66 Added: "muscle_group_id" INTEGER NOT NULL,
67 Added: "latin_name" TEXT NOT NULL UNIQUE,
68 Added: "english_name" TEXT,
69 Added: "function" TEXT,
70 Added: FOREIGN KEY("muscle_group_id") REFERENCES Muscle_Groups("id"),
71 Added: PRIMARY KEY("id" AUTOINCREMENT)
72 Added: );
73 Added:
74 Added: -- Upper body
75 Added: INSERT INTO Muscles ("muscle_group_id", "latin_name", "english_name", "function") VALUES
76 Added: ('2',
77 Added: 'latissimus dorsi',
78 Added: 'lats',
79 Added: 'adducts and extends the shoulder'
80 Added: ),
81 Added: ('2',
82 Added: 'trapezius',
83 Added: 'trap',
84 Added: 'assists in moving and stabilizing the shoulder blades'
85 Added: ),
86 Added: ('3',
87 Added: 'deltoideus',
88 Added: 'delts',
89 Added: NULL
90 Added: ),
91 Added: ('4',
92 Added: 'pectoralis major',
93 Added: 'pecs',
94 Added: 'performs shoulder flexion and adduction'
95 Added: ),
96 Added: ('4',
97 Added: 'pectorali minor',
98 Added: 'pectoral',
99 Added: 'plays a role in stabilizing the shoulder blade and assists in deep breathing'
100 Added: ),
101 Added: ('5',
102 Added: 'triceps brachii',
103 Added: 'triceps',
104 Added: NULL
105 Added: ),
106 Added: ('6',
107 Added: 'biceps brachii',
108 Added: 'biceps',
109 Added: NULL
110 Added: ),
111 Added: ('7',
112 Added: 'extensor carpi radialias brevis',
113 Added: NULL,
114 Added: 'Responsible for extending the wrist and abducting the hand'
115 Added: ),
116 Added: ('7',
117 Added: 'brachio radialis',
118 Added: NULL,
119 Added: 'Responsible for flexing the forearm at the elbow joint'
120 Added: ),
121 Added: ('7',
122 Added: 'flexor carpi radialis',
123 Added: NULL,
124 Added: 'Responsible for flexing the wrist and abducting the hand'
125 Added: ),
126 Added: ('7',
127 Added: 'extensor carpi ulnaris',
128 Added: NULL,
129 Added: 'Responsible for extending the wrist and adducting the hand'
130 Added: ),
131 Added: ('7',
132 Added: 'flexor carpi ulnaris',
133 Added: NULL,
134 Added: 'Responsible for flexing the wrist and adducting the hand'
135 Added: ),
136 Added: ('7',
137 Added: 'extensor carpi radialis longus',
138 Added: NULL,
139 Added: 'Responsible for extending the wrist and abducting the hand'
140 Added: );
141 Added:
142 Added: -- Core
143 Added: INSERT INTO Muscles ("muscle_group_id", "latin_name", "english_name", "function") VALUES
144 Added: ('8',
145 Added: 'abdominalis',
146 Added: 'abs',
147 Added: 'wraps around the spine for protection and stability'
148 Added: ),
149 Added: ('8',
150 Added: 'obliquus externus abdominis',
151 Added: 'external oblique',
152 Added: NULL
153 Added: ),
154 Added: ('8',
155 Added: 'rectus abdominis',
156 Added: 'six-pack',
157 Added: NULL
158 Added: ),
159 Added: ('8',
160 Added: 'obliquus internus abdominis',
161 Added: 'internal oblique',
162 Added: 'Located on the front and side of the abdomen'
163 Added: ),
164 Added: ('9',
165 Added: 'erector spinae',
166 Added: 'erectors',
167 Added: 'extends the vertebral column and ensures maintaining an upright posture'
168 Added: ),
169 Added: ('11',
170 Added: 'gluteus maximus',
171 Added: NULL,
172 Added: 'performs hip extension, outward rotation, and abduction'
173 Added: ),
174 Added: ('11',
175 Added: 'gluteus medius',
176 Added: NULL,
177 Added: 'plays a role in hip abduction and medial rotation'
178 Added: ),
179 Added: ('11',
180 Added: 'gluteus minimus',
181 Added: NULL,
182 Added: 'assists in hip abduction and medial rotation, works with the gluteus medius'
183 Added: );
184 Added:
185 Added: -- Lower body
186 Added: INSERT INTO Muscles ("muscle_group_id", "latin_name", "english_name", "function") VALUES
187 Added: ('12',
188 Added: 'quadriceps femoris',
189 Added: 'quad',
190 Added: NULL
191 Added: ),
192 Added: ('13',
193 Added: 'biceps femoris',
194 Added: 'hamstrings',
195 Added: NULL
196 Added: ),
197 Added: ('13',
198 Added: 'semitendinosus',
199 Added: 'hamstrings',
200 Added: NULL
201 Added: ),
202 Added: ('13',
203 Added: 'semimembranosus',
204 Added: 'hamstrings',
205 Added: NULL
206 Added: ),
207 Added: ('14',
208 Added: 'gastrocnemius',
209 Added: NULL,
210 Added: 'performs plantar flexion of the foot (pointing toes)'
211 Added: ),
212 Added: ('14',
213 Added: 'soleus',
214 Added: NULL,
215 Added: 'assists the gastrocnemius in plantar flexion and helps maintain posture'
216 Added: );
217 Added:
218 Added: CREATE TABLE "Exercises" (
219 Added: "id" INTEGER NOT NULL UNIQUE,
220 Added: "primary_muscle_group_id" INTEGER NOT NULL,
221 Added: "english_name" TEXT NOT NULL,
222 Added: "french_name" TEXT,
223 Added: FOREIGN KEY("primary_muscle_group_id") REFERENCES Muscle_Groups("id"),
224 Added: PRIMARY KEY("id" AUTOINCREMENT)
225 Added: );
226 Added:
227 Added: INSERT INTO Exercises ("primary_muscle_group_id", "english_name", "french_name") VALUES
228 Added: -- Leading zero enables using sort-lines in Emacs
229 Added: (02, 'cable row', 'rame avec cable'),
230 Added: ('02', 'deadlift', 'soulevé de terre'),
231 Added: ('02', 'lat pulldown', NULL),
232 Added: ('02', 'pull up', 'traction'),
233 Added: ('03', 'shoulder press (dumbell)', NULL),
234 Added: ('04', 'bench press', 'développé couché'),
235 Added: ('04', 'decline bench press', 'développé couché, incliné négatif'),
236 Added: ('04', 'incline bench press', 'développé couché, incliné positif'),
237 Added: ('05', 'tricep extension', 'extension triceps'),
238 Added: ('06', 'bicep curl', 'flexion biceps'),
239 Added: ('06', 'hammer curl', 'curl marteau'),
240 Added: ('09', 'snatch', 'arraché'),
241 Added: ('12', 'barbell squat', 'flexion sur jambes avec barre'),
242 Added: ('12', 'clean and jerk', 'épaulé-jeté'),
243 Added: ('12', 'goblet squat', NULL),
244 Added: ('12', 'leg extension', NULL),
245 Added: ('13', 'leg curl', NULL);
246 Added:
247 Added: CREATE TABLE "Weights" (
248 Added: "id" INTEGER UNIQUE,
249 Added: "user_id" INTEGER NOT NULL,
250 Added: "date" TEXT NOT NULL,
251 Added: "value" NUMERIC NOT NULL,
252 Added: PRIMARY KEY("id" AUTOINCREMENT)
253 Added: );
254 Added:
255 Added: CREATE TABLE "Workouts" (
256 Added: "id" INTEGER UNIQUE,
257 Added: "user_id" INTEGER NOT NULL,
258 Added: "date" TEXT NOT NULL,
259 Added: "primary_muscle" TEXT,
260 Added: "secondary_muscles" TEXT,
261 Added: PRIMARY KEY("id" AUTOINCREMENT)
262 Added: );
263 Added:
264 Added: CREATE TABLE "Reps" (
265 Added: "id" INTEGER NOT NULL UNIQUE,
266 Added: "workout_id" INTEGER NOT NULL,
267 Added: "set_group" INTEGER NOT NULL,
268 Added: "set" INTEGER NOT NULL,
269 Added: "amount" INTEGER NOT NULL,
270 Added: "load" INTEGER,
271 Added: "rpe" INTEGER,
272 Added: "rest_after" NUMERIC,
273 Added: FOREIGN KEY("workout_id") REFERENCES Workouts("id"),
274 Added: PRIMARY KEY("id" AUTOINCREMENT)
275 Added: );
276 Added:
277 Added: -- Local Variables:
278 Added: -- sql-product: sqlite
279 Added: -- End: