sjthespian / addon-tuyagateway

An addon for the [TuyaGateway][tuyagateway] application.
MIT License
17 stars 3 forks source link

run.sh: Don't consider valid a non-initialized database file #3

Closed 3v1n0 closed 4 years ago

3v1n0 commented 4 years ago

If the user stops the addon while GismoCaster is still initializing the db, at the next reboot the DB initialization won't be repeated and the user will face a login issue (as per missing admin user).

So, consider as initialized a DB only in the case that the setup process is completed, and not as soon as the sqlite3 file is created.

Using a versioned stub file, so that this codepath can be adapted in future if only migrations will be needed.