Check for writable database before starting

This commit is contained in:
Marty Oehme 2021-12-06 19:43:19 +01:00
parent 3da96a3ef8
commit f9044daba1
Signed by: Marty
GPG key ID: B7538B8F50A1C800
2 changed files with 4 additions and 0 deletions

View file

@ -17,6 +17,7 @@ and this project tries to adhere to [Semantic Versioning](https://semver.org/spe
### Fixed ### Fixed
* Create missing PRAGMA values for Loop SQLite database, fixing failing import * Create missing PRAGMA values for Loop SQLite database, fixing failing import
* Check for database existing and able to connect to before doing any writing
## [0.3.1] - 2021-09-30 ## [0.3.1] - 2021-09-30

3
run.py
View file

@ -11,6 +11,9 @@ import sys
def migrate(data: NomieImport): def migrate(data: NomieImport):
db = schema.migrate("output.db") db = schema.migrate("output.db")
if not db:
raise ConnectionError
if data.trackers is not None: if data.trackers is not None:
habitlist = habits.migrate(db, data.trackers) habitlist = habits.migrate(db, data.trackers)