lbry-sdk/lbry/extras/daemon/migrator/migrate13to14.py

22 lines
520 B
Python
Raw Permalink Normal View History

2019-11-23 20:51:03 +01:00
import os
import sqlite3
def do_migration(conf):
db_path = os.path.join(conf.data_dir, "lbrynet.sqlite")
connection = sqlite3.connect(db_path)
cursor = connection.cursor()
cursor.executescript("""
create table if not exists peer (
node_id char(96) not null primary key,
address text not null,
udp_port integer not null,
tcp_port integer,
unique (address, udp_port)
);
""")
connection.commit()
connection.close()