[Pharo] Personal fitness tracker web app.
Fix baseline 16.
src/MyFitnessTracker/MFTSQLite3Database.class.st
@@ -178,15 +178,20 @@
178
178
179
179
defaultLocation := (Smalltalk imageDirectory / 'mft.sqlite3')
180
180
fullName.
181
Removed:
(FileSystem / defaultLocation) exists
182
Removed:
ifTrue: [
183
Removed:
allMuscleGroups := self getAllMuscleGroups.
184
Removed:
allMuscles := self getAllMuscles.
185
Removed:
allExercises := self getAllExercises.
186
Removed:
testUser := self getTestUser ]
187
Removed:
ifFalse: [
181
Added:
(FileSystem / defaultLocation) exists ifFalse: [
182
Added:
| schema returnCode |
183
Added:
schema := (Smalltalk imageDirectory
184
Added:
/ 'pharo-local/iceberg/my-fitness-tracker/mft-schema.sql')
185
Added:
fullName.
186
Added:
returnCode := LibC runCommand:
187
Added:
'sqlite3 ' , defaultLocation , ' < ' , schema.
188
Added:
returnCode ~= 0 ifTrue: [
188
189
self error:
189
Removed:
'Please run the mft-schema.sql script to create the database.' ]
190
Added:
'Non-zero return code when attempting to create the MFT database.' ] ].
191
Added:
allMuscleGroups := self getAllMuscleGroups.
192
Added:
allMuscles := self getAllMuscles.
193
Added:
allExercises := self getAllExercises.
194
Added:
testUser := self getTestUser
190
195
]
191
196
192
197
{ #category : #'instance creation' }