diff --git a/lbry/wallet/database.py b/lbry/wallet/database.py index 24a8e1d75..e86a90ebf 100644 --- a/lbry/wallet/database.py +++ b/lbry/wallet/database.py @@ -446,6 +446,10 @@ class SQLiteMixin: version = await self.db.execute_fetchone("SELECT version FROM version LIMIT 1;") if version == (self.SCHEMA_VERSION,): return + if version == ("1.5",) and self.SCHEMA_VERSION == "1.6": + await self.db.execute("ALTER TABLE txo ADD COLUMN has_source bool;") + await self.db.execute("UPDATE version SET version = ?", (self.SCHEMA_VERSION,)) + return await self.db.executescript('\n'.join( f"DROP TABLE {table};" for table in tables ) + '\n' + 'PRAGMA WAL_CHECKPOINT(FULL);' + '\n' + 'VACUUM;')