lbry-sdk/lbrynet/database/migrator/migrate6to7.py

13 lines
365 B
Python
Raw Normal View History

2018-03-27 20:58:29 +02:00
import sqlite3
import os
def do_migration(db_dir):
db_path = os.path.join(db_dir, "lbrynet.sqlite")
connection = sqlite3.connect(db_path)
cursor = connection.cursor()
cursor.executescript("alter table blob add last_announced_time integer;")
cursor.execute("update blob set next_announce_time=0")
connection.commit()
connection.close()