Update some db types
This commit is contained in:
parent
101d9ab87f
commit
0691bbaad9
@ -1196,7 +1196,7 @@ class Trade(ModelBase, LocalTrade):
|
|||||||
fee_close_cost: Mapped[Optional[float]] = mapped_column(Float(), nullable=True)
|
fee_close_cost: Mapped[Optional[float]] = mapped_column(Float(), nullable=True)
|
||||||
fee_close_currency: Mapped[Optional[str]] = mapped_column(String(25), nullable=True)
|
fee_close_currency: Mapped[Optional[str]] = mapped_column(String(25), nullable=True)
|
||||||
open_rate: Mapped[float] = mapped_column(Float())
|
open_rate: Mapped[float] = mapped_column(Float())
|
||||||
open_rate_requested: Mapped[float] = mapped_column(Float())
|
open_rate_requested: Mapped[float] = mapped_column(Float(), nullable=True)
|
||||||
# open_trade_value - calculated via _calc_open_trade_value
|
# open_trade_value - calculated via _calc_open_trade_value
|
||||||
open_trade_value = mapped_column(Float())
|
open_trade_value = mapped_column(Float())
|
||||||
close_rate: Mapped[Optional[float]] = mapped_column(Float())
|
close_rate: Mapped[Optional[float]] = mapped_column(Float())
|
||||||
|
@ -21,7 +21,7 @@ spot, margin, futures = TradingMode.SPOT, TradingMode.MARGIN, TradingMode.FUTURE
|
|||||||
def test_init_create_session(default_conf):
|
def test_init_create_session(default_conf):
|
||||||
# Check if init create a session
|
# Check if init create a session
|
||||||
init_db(default_conf['db_url'])
|
init_db(default_conf['db_url'])
|
||||||
assert hasattr(Trade, '_session')
|
assert hasattr(Trade, 'session')
|
||||||
assert 'scoped_session' in type(Trade.session).__name__
|
assert 'scoped_session' in type(Trade.session).__name__
|
||||||
|
|
||||||
|
|
||||||
|
@ -2440,6 +2440,7 @@ def test_select_filled_orders(fee):
|
|||||||
def test_order_to_ccxt(limit_buy_order_open):
|
def test_order_to_ccxt(limit_buy_order_open):
|
||||||
|
|
||||||
order = Order.parse_from_ccxt_object(limit_buy_order_open, 'mocked', 'buy')
|
order = Order.parse_from_ccxt_object(limit_buy_order_open, 'mocked', 'buy')
|
||||||
|
order.ft_trade_id = 1
|
||||||
order.query.session.add(order)
|
order.query.session.add(order)
|
||||||
Order.query.session.commit()
|
Order.query.session.commit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user