From f5ff6ceead76c07779e27126caf76621c12e1a11 Mon Sep 17 00:00:00 2001 From: Matthias Voppichler Date: Sat, 12 May 2018 10:29:10 +0200 Subject: [PATCH] Rename instead of drop/create --- freqtrade/persistence.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/freqtrade/persistence.py b/freqtrade/persistence.py index 7170ab4ff..c6a185188 100644 --- a/freqtrade/persistence.py +++ b/freqtrade/persistence.py @@ -73,9 +73,7 @@ def check_migrate(engine) -> None: if not has_column(cols, 'fee_open'): # Schema migration necessary - engine.execute("drop table if exists trades_bak") - engine.execute("create table trades_bak as select * from trades") - engine.execute("drop table if exists trades") + engine.execute("alter table trades rename to trades_bak") # let SQLAlchemy create the schema as required _DECL_BASE.metadata.create_all(engine)