Best Python code snippet using autotest_python
dbmigrator.py
Source:dbmigrator.py
...38 from .migrate15to16 import do_migration39 else:40 raise Exception(f"DB migration of version {current} to {current+1} is not available")41 try:42 do_migration(conf)43 except Exception:44 log.exception("failed to migrate database")45 if os.path.exists(os.path.join(conf.data_dir, "lbrynet.sqlite")):46 backup_name = f"rev_{current}_unmigrated_database"47 count = 048 while os.path.exists(os.path.join(conf.data_dir, backup_name + ".sqlite")):49 count += 150 backup_name = f"rev_{current}_unmigrated_database_{count}"51 backup_path = os.path.join(conf.data_dir, backup_name + ".sqlite")52 os.rename(os.path.join(conf.data_dir, "lbrynet.sqlite"), backup_path)53 log.info("made a backup of the unmigrated database: %s", backup_path)54 if os.path.isfile(os.path.join(conf.data_dir, "db_revision")):55 os.remove(os.path.join(conf.data_dir, "db_revision"))56 return None...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!