fix feedback

This commit is contained in:
kevinjulian 2021-07-20 20:40:32 +07:00
parent 3d8b2d601d
commit c558fc0b17
2 changed files with 9 additions and 2 deletions

View File

@ -11,6 +11,6 @@ class SignalType(Enum):
class SignalNameType(Enum):
"""
Enum for signal name
Enum for signal columns
"""
BUY_SIGNAL_NAME = "buy_signal_name"

View File

@ -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!