From f374c9da705531dc6752a0b384d9664d8b052f2a Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 11 May 2022 06:30:40 +0200 Subject: [PATCH] PR cleanup --- docs/utils.md | 2 +- freqtrade/commands/cli_options.py | 2 +- freqtrade/commands/db_commands.py | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/utils.md b/docs/utils.md index a8b8a57e3..9b799e5fc 100644 --- a/docs/utils.md +++ b/docs/utils.md @@ -569,7 +569,7 @@ optional arguments: deployments (default: `sqlite:///tradesv3.sqlite` for Live Run mode, `sqlite:///tradesv3.dryrun.sqlite` for Dry Run). - --db-url-from PATH Source db url to use when migrating database systems. + --db-url-from PATH Source db url to use when migrating a database. ``` !!! Warning diff --git a/freqtrade/commands/cli_options.py b/freqtrade/commands/cli_options.py index 24ca01760..aac9f5713 100644 --- a/freqtrade/commands/cli_options.py +++ b/freqtrade/commands/cli_options.py @@ -108,7 +108,7 @@ AVAILABLE_CLI_OPTIONS = { ), "db_url_from": Arg( '--db-url-from', - help='Source db url to use when migrating database systems.', + help='Source db url to use when migrating a database.', metavar='PATH', ), "sd_notify": Arg( diff --git a/freqtrade/commands/db_commands.py b/freqtrade/commands/db_commands.py index 762c3c343..d93aafcb6 100644 --- a/freqtrade/commands/db_commands.py +++ b/freqtrade/commands/db_commands.py @@ -5,8 +5,6 @@ from sqlalchemy import func from freqtrade.configuration.config_setup import setup_utils_configuration from freqtrade.enums.runmode import RunMode -from freqtrade.persistence.migrations import set_sequence_ids -from freqtrade.persistence.trade_model import Order logger = logging.getLogger(__name__) @@ -15,7 +13,8 @@ logger = logging.getLogger(__name__) def start_convert_db(args: Dict[str, Any]) -> None: from sqlalchemy.orm import make_transient - from freqtrade.persistence import Trade, init_db + from freqtrade.persistence import Order, Trade, init_db + from freqtrade.persistence.migrations import set_sequence_ids from freqtrade.persistence.pairlock import PairLock config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE) @@ -25,7 +24,6 @@ def start_convert_db(args: Dict[str, Any]) -> None: init_db(config['db_url_from'], False) logger.info("Starting db migration.") - # print(f"{id(sessionA)=}, {id(sessionB)=}") trade_count = 0 pairlock_count = 0 for trade in Trade.get_trades():