forked from LBRYCommunity/lbry-sdk
migration specifically for upgrading from client db v1.5 to v1.6
This commit is contained in:
parent
f729490c6b
commit
575d6dcd2d
1 changed files with 4 additions and 0 deletions
|
@ -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;')
|
||||
|
|
Loading…
Reference in a new issue