2015-09-08 05:59:59 +02:00
|
|
|
import logging
|
2016-09-01 02:45:49 +02:00
|
|
|
# import os
|
2015-09-08 05:59:59 +02:00
|
|
|
|
|
|
|
|
2015-09-04 22:22:02 +02:00
|
|
|
def migrate_db(db_dir, start, end):
|
|
|
|
current = start
|
|
|
|
old_dirs = []
|
2016-09-01 02:41:29 +02:00
|
|
|
# if os.name == "nt":
|
|
|
|
# return old_dirs
|
|
|
|
# while current < end:
|
|
|
|
# if current == 0:
|
|
|
|
# from lbrynet.db_migrator.migrate0to1 import do_migration
|
|
|
|
# old_dirs.append(do_migration(db_dir))
|
|
|
|
# current += 1
|
2015-09-04 22:22:02 +02:00
|
|
|
return old_dirs
|
|
|
|
|
|
|
|
|
|
|
|
def run_migration_script():
|
|
|
|
import sys
|
2015-09-08 05:59:59 +02:00
|
|
|
log_format = "(%(asctime)s)[%(filename)s:%(lineno)s] %(funcName)s(): %(message)s"
|
|
|
|
logging.basicConfig(level=logging.DEBUG, format=log_format, filename="migrator.log")
|
|
|
|
sys.stdout = open("migrator.out.log", 'w')
|
|
|
|
sys.stderr = open("migrator.err.log", 'w')
|
|
|
|
migrate_db(sys.argv[1], int(sys.argv[2]), int(sys.argv[3]))
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
run_migration_script()
|