Override SQLAlchemy drop_all()
to call drop_alembic_version_table()
#98
Labels
Milestone
drop_all()
to call drop_alembic_version_table()
#98
As spotted by @dinosk in this troubleshooting, the call to
db.drop_all()
will NOT delete thealembic
tablealembic_version
.This can lead to several unpredictable issues.
The
drop_all()
method should drop ALL tables, and not left something behind.A workaround has been provided with the method
invenio_db.utils.drop_alembic_version_table()
.Proposed solution
Override the SQLAlchemy
db.drop_all()
method to (pseudo-code):WARNING: this modification can potentially break other modules' tests. Moreover, whenever the function
drop_alembic_version_table()
is used after adrop_all()
, it should be cleaned up.The text was updated successfully, but these errors were encountered: