From c558fc0b17c10e1ca2eb7bf1020d3712b6a9ab9c Mon Sep 17 00:00:00 2001 From: kevinjulian Date: Tue, 20 Jul 2021 20:40:32 +0700 Subject: [PATCH] fix feedback --- freqtrade/enums/signaltype.py | 2 +- freqtrade/persistence/migrations.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/freqtrade/enums/signaltype.py b/freqtrade/enums/signaltype.py index 6f29699f1..8529c6b79 100644 --- a/freqtrade/enums/signaltype.py +++ b/freqtrade/enums/signaltype.py @@ -11,6 +11,6 @@ class SignalType(Enum): class SignalNameType(Enum): """ - Enum for signal name + Enum for signal columns """ BUY_SIGNAL_NAME = "buy_signal_name" diff --git a/freqtrade/persistence/migrations.py b/freqtrade/persistence/migrations.py index 4fa1cb742..f6a345ed1 100644 --- a/freqtrade/persistence/migrations.py +++ b/freqtrade/persistence/migrations.py @@ -161,7 +161,14 @@ def check_migrate(engine, decl_base, previous_tables) -> None: table_back_name = get_backup_name(tabs, 'trades_bak') # Check for latest column - if not has_column(cols, 'open_trade_value') or not has_column(cols, 'buy_signal_name'): + if not has_column(cols, 'open_trade_value'): + logger.info(f'Running database migration for trades - backup: {table_back_name}') + migrate_trades_table(decl_base, inspector, engine, table_back_name, cols) + # Reread columns - the above recreated the table! + inspector = inspect(engine) + cols = inspector.get_columns('trades') + + if not has_column(cols, 'buy_signal_name'): logger.info(f'Running database migration for trades - backup: {table_back_name}') migrate_trades_table(decl_base, inspector, engine, table_back_name, cols) # Reread columns - the above recreated the table!