Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing
COMMIT
after creating stats DB
Each time when starting, the bot reads the `schema_version` table in `stats.db` and verifies that it's equal to the current schema version. This is so that in the future we can have migration code that will convert users' databases from one schema to another. If this table does not exist (or is empty) the bot will attempt to initialise the schema. Then, it writes the current schema version to the `schema_version` table. Unfortunately, I forgot a `COMMIT` after that `INSERT` statement -- so the database transaction was still 'open' until another write was made (i.e. an encounter happened.) If the user closed a new profile _before_ anything else was written, the `schema_version` table would remain empty and lead to an error message during the next start of that profile.
- Loading branch information