From 93eb693beeb049ecd6eec3fff120fedaeecba7f7 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 27 Jan 2020 20:46:32 -0800 Subject: [PATCH] Separate version_pragma from other pragmas! This was a dumb bug. Because the version was included in the pragmas that get set on every load, the database was receiving the new user_version simply by setting skip_version_check=False and letting the regular pragmas load, so all future checks passed without having to run the db upgrader. --- etiquette/constants.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etiquette/constants.py b/etiquette/constants.py index 98eab7c..8150cf3 100644 --- a/etiquette/constants.py +++ b/etiquette/constants.py @@ -43,15 +43,19 @@ ffmpeg = _load_ffmpeg() # Database ######################################################################################### DATABASE_VERSION = 14 +DB_VERSION_PRAGMA = f''' +PRAGMA user_version = {DATABASE_VERSION}; +''' + DB_PRAGMAS = f''' PRAGMA cache_size = 10000; PRAGMA count_changes = OFF; PRAGMA foreign_keys = ON; -PRAGMA user_version = {DATABASE_VERSION}; ''' DB_INIT = f''' {DB_PRAGMAS} +{DB_VERSION_PRAGMA} ---------------------------------------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS users( id TEXT PRIMARY KEY NOT NULL,