Update some db types

This commit is contained in:
Matthias 2023-02-19 20:18:46 +01:00
parent 101d9ab87f
commit 0691bbaad9
3 changed files with 3 additions and 2 deletions

View File

@ -1196,7 +1196,7 @@ class Trade(ModelBase, LocalTrade):
fee_close_cost: Mapped[Optional[float]] = mapped_column(Float(), nullable=True)
fee_close_currency: Mapped[Optional[str]] = mapped_column(String(25), nullable=True)
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 = mapped_column(Float())
close_rate: Mapped[Optional[float]] = mapped_column(Float())

View File

@ -21,7 +21,7 @@ spot, margin, futures = TradingMode.SPOT, TradingMode.MARGIN, TradingMode.FUTURE
def test_init_create_session(default_conf):
# Check if init create a session
init_db(default_conf['db_url'])
assert hasattr(Trade, '_session')
assert hasattr(Trade, 'session')
assert 'scoped_session' in type(Trade.session).__name__

View File

@ -2440,6 +2440,7 @@ def test_select_filled_orders(fee):
def test_order_to_ccxt(limit_buy_order_open):
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.commit()