Fix migration syntax error
This commit is contained in:
parent
ed4cc18cdd
commit
16573b19e3
@ -223,7 +223,7 @@ def migrate_orders_table(engine, table_back_name: str, cols_order: List):
|
|||||||
select id, ft_trade_id, ft_order_side, ft_pair, ft_is_open, order_id,
|
select id, ft_trade_id, ft_order_side, ft_pair, ft_is_open, order_id,
|
||||||
status, symbol, order_type, side, price, amount, filled, {average} average, remaining,
|
status, symbol, order_type, side, price, amount, filled, {average} average, remaining,
|
||||||
cost, {stop_price} stop_price, order_date, order_filled_date,
|
cost, {stop_price} stop_price, order_date, order_filled_date,
|
||||||
order_update_date, {ft_fee_base} ft_fee_base {funding_fee} funding_fee
|
order_update_date, {ft_fee_base} ft_fee_base, {funding_fee} funding_fee
|
||||||
from {table_back_name}
|
from {table_back_name}
|
||||||
"""))
|
"""))
|
||||||
|
|
||||||
@ -310,8 +310,8 @@ def check_migrate(engine, decl_base, previous_tables) -> None:
|
|||||||
# if ('orders' not in previous_tables
|
# if ('orders' not in previous_tables
|
||||||
# or not has_column(cols_orders, 'funding_fee')):
|
# or not has_column(cols_orders, 'funding_fee')):
|
||||||
migrating = False
|
migrating = False
|
||||||
if not has_column(cols_orders, 'funding_fee'):
|
|
||||||
# if not has_column(cols_trades, 'contract_size'):
|
# if not has_column(cols_trades, 'contract_size'):
|
||||||
|
if not has_column(cols_orders, 'funding_fee'):
|
||||||
migrating = True
|
migrating = True
|
||||||
logger.info(f"Running database migration for trades - "
|
logger.info(f"Running database migration for trades - "
|
||||||
f"backup: {table_back_name}, {order_table_bak_name}")
|
f"backup: {table_back_name}, {order_table_bak_name}")
|
||||||
|
@ -369,7 +369,8 @@ class LocalTrade():
|
|||||||
orders = self.select_filled_orders()
|
orders = self.select_filled_orders()
|
||||||
if not orders:
|
if not orders:
|
||||||
return self.open_date_utc
|
return self.open_date_utc
|
||||||
return max([self.open_date_utc, max(o.order_filled_utc for o in orders)])
|
return max([self.open_date_utc,
|
||||||
|
max(o.order_filled_utc for o in orders if o.order_filled_utc)])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def open_date_utc(self):
|
def open_date_utc(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user