From 9200f5b516479e44054add87ea9a461c87fad735 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 28 Oct 2019 12:20:15 -0400 Subject: [PATCH] fix 11to12 migration typo --- lbry/lbry/extras/daemon/migrator/dbmigrator.py | 4 ++-- lbry/lbry/extras/daemon/migrator/migrate11to12.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lbry/lbry/extras/daemon/migrator/dbmigrator.py b/lbry/lbry/extras/daemon/migrator/dbmigrator.py index 807cb1907..94df761f0 100644 --- a/lbry/lbry/extras/daemon/migrator/dbmigrator.py +++ b/lbry/lbry/extras/daemon/migrator/dbmigrator.py @@ -35,8 +35,8 @@ def migrate_db(conf, start, end): raise Exception(f"DB migration of version {current} to {current+1} is not available") try: do_migration(conf) - except Exception as err: - log.info("failed to migrate database: %s", str(err)) + except Exception: + log.exception("failed to migrate database") if os.path.exists(os.path.join(conf.data_dir, "lbrynet.sqlite")): backup_name = f"rev_{current}_unmigrated_database" count = 0 diff --git a/lbry/lbry/extras/daemon/migrator/migrate11to12.py b/lbry/lbry/extras/daemon/migrator/migrate11to12.py index fa57e2119..b58462296 100644 --- a/lbry/lbry/extras/daemon/migrator/migrate11to12.py +++ b/lbry/lbry/extras/daemon/migrator/migrate11to12.py @@ -40,12 +40,12 @@ def do_migration(conf): # step 5: transfer content from old to new select = "select * from file" - for (stream_hash, file_name, download_dir, data_rate, blob_rate, status, saved_file, fee) \ + for (stream_hash, file_name, download_dir, blob_rate, status, saved_file, fee) \ in cursor.execute(select).fetchall(): added_on = int(time.time()) cursor.execute( "insert into new_file values (?, ?, ?, ?, ?, ?, ?, ?)", - (stream_hash, file_name, download_dir, data_rate, blob_rate, status, saved_file, fee, added_on) + (stream_hash, file_name, download_dir, blob_rate, status, saved_file, fee, added_on) ) # step 6: drop old table