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.
This commit is contained in:
voussoir 2020-01-27 20:46:32 -08:00
parent 222d63857e
commit 93eb693bee

View file

@ -43,15 +43,19 @@ ffmpeg = _load_ffmpeg()
# Database ######################################################################################### # Database #########################################################################################
DATABASE_VERSION = 14 DATABASE_VERSION = 14
DB_VERSION_PRAGMA = f'''
PRAGMA user_version = {DATABASE_VERSION};
'''
DB_PRAGMAS = f''' DB_PRAGMAS = f'''
PRAGMA cache_size = 10000; PRAGMA cache_size = 10000;
PRAGMA count_changes = OFF; PRAGMA count_changes = OFF;
PRAGMA foreign_keys = ON; PRAGMA foreign_keys = ON;
PRAGMA user_version = {DATABASE_VERSION};
''' '''
DB_INIT = f''' DB_INIT = f'''
{DB_PRAGMAS} {DB_PRAGMAS}
{DB_VERSION_PRAGMA}
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS users( CREATE TABLE IF NOT EXISTS users(
id TEXT PRIMARY KEY NOT NULL, id TEXT PRIMARY KEY NOT NULL,