Rename instead of drop/create
This commit is contained in:
parent
81ee6f8265
commit
f5ff6ceead
@ -73,9 +73,7 @@ def check_migrate(engine) -> None:
|
|||||||
|
|
||||||
if not has_column(cols, 'fee_open'):
|
if not has_column(cols, 'fee_open'):
|
||||||
# Schema migration necessary
|
# Schema migration necessary
|
||||||
engine.execute("drop table if exists trades_bak")
|
engine.execute("alter table trades rename to trades_bak")
|
||||||
engine.execute("create table trades_bak as select * from trades")
|
|
||||||
engine.execute("drop table if exists trades")
|
|
||||||
# let SQLAlchemy create the schema as required
|
# let SQLAlchemy create the schema as required
|
||||||
_DECL_BASE.metadata.create_all(engine)
|
_DECL_BASE.metadata.create_all(engine)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user