Added changes suggested in pull request, fixed breaking changes,

can run the bot again
This commit is contained in:
Sam Germain
2021-06-20 03:01:03 -06:00
parent 741ca0e58c
commit 10979361c1
2 changed files with 26 additions and 21 deletions

View File

@@ -45,14 +45,15 @@ def migrate_trades_table(decl_base, inspector, engine, table_back_name: str, col
stoploss_last_update = get_column_def(cols, 'stoploss_last_update', 'null')
max_rate = get_column_def(cols, 'max_rate', '0.0')
min_rate = get_column_def(cols, 'min_rate', 'null')
close_reason = get_column_def(cols, 'close_reason', 'null')
sell_reason = get_column_def(cols, 'sell_reason', 'null')
strategy = get_column_def(cols, 'strategy', 'null')
leverage = get_column_def(cols, 'leverage', '0.0')
borrowed = get_column_def(cols, 'borrowed', '0.0')
borrowed_currency = get_column_def(cols, 'borrowed_currency', 'null')
collateral_currency = get_column_def(cols, 'collateral_currency', 'null')
interest_rate = get_column_def(cols, 'interest_rate', '0.0')
min_stoploss = get_column_def(cols, 'min_stoploss', 'null')
liquidation_price = get_column_def(cols, 'liquidation_price', 'null')
is_short = get_column_def(cols, 'is_short', 'False')
# If ticker-interval existed use that, else null.
if has_column(cols, 'ticker_interval'):
@@ -87,9 +88,9 @@ def migrate_trades_table(decl_base, inspector, engine, table_back_name: str, col
stake_amount, amount, amount_requested, open_date, close_date, open_order_id,
stop_loss, stop_loss_pct, initial_stop_loss, initial_stop_loss_pct,
stoploss_order_id, stoploss_last_update,
max_rate, min_rate, close_reason, close_order_status, strategy,
max_rate, min_rate, sell_reason, close_order_status, strategy,
timeframe, open_trade_value, close_profit_abs,
leverage, borrowed, borrowed_currency, interest_rate, min_stoploss, is_short
leverage, borrowed, borrowed_currency, collateral_currency, interest_rate, liquidation_price, is_short
)
select id, lower(exchange),
case
@@ -109,12 +110,13 @@ def migrate_trades_table(decl_base, inspector, engine, table_back_name: str, col
{initial_stop_loss} initial_stop_loss,
{initial_stop_loss_pct} initial_stop_loss_pct,
{stoploss_order_id} stoploss_order_id, {stoploss_last_update} stoploss_last_update,
{max_rate} max_rate, {min_rate} min_rate, {close_reason} close_reason,
{max_rate} max_rate, {min_rate} min_rate, {sell_reason} sell_reason,
{close_order_status} close_order_status,
{strategy} strategy, {timeframe} timeframe,
{open_trade_value} open_trade_value, {close_profit_abs} close_profit_abs,
{leverage} leverage, {borrowed} borrowed, {borrowed_currency} borrowed_currency,
{interest_rate} interest_rate, {min_stoploss} min_stoploss, {is_short} is_short
{collateral_currency} collateral_currency, {interest_rate} interest_rate,
{liquidation_price} liquidation_price, {is_short} is_short
from {table_back_name}
"""))