Update migrations to also support Postgres

closes #7038
This commit is contained in:
Matthias 2022-07-04 11:14:59 +02:00
parent edc9a42a4c
commit 6da3fa08e4

View File

@ -255,8 +255,8 @@ def fix_old_dry_orders(engine):
text( text(
""" """
update orders update orders
set ft_is_open = 0 set ft_is_open = false
where ft_is_open = 1 and (ft_trade_id, order_id) not in ( where ft_is_open = true and (ft_trade_id, order_id) not in (
select id, stoploss_order_id from trades where stoploss_order_id is not null select id, stoploss_order_id from trades where stoploss_order_id is not null
) and ft_order_side = 'stoploss' ) and ft_order_side = 'stoploss'
and order_id like 'dry_%' and order_id like 'dry_%'
@ -267,8 +267,8 @@ def fix_old_dry_orders(engine):
text( text(
""" """
update orders update orders
set ft_is_open = 0 set ft_is_open = false
where ft_is_open = 1 where ft_is_open = true
and (ft_trade_id, order_id) not in ( and (ft_trade_id, order_id) not in (
select id, open_order_id from trades where open_order_id is not null select id, open_order_id from trades where open_order_id is not null
) and ft_order_side != 'stoploss' ) and ft_order_side != 'stoploss'