You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now I am using PostgreSQL and got some problems with options SQLALCHEMYBACKEND_CLEAR_CONTENT and SQLALCHEMYBACKEND_DROP_ALL_TABLES when they are set to True.
These options are used in this function:
I also think that the session can be created only once, before loop (and committed and closed after).
Now about DROP_ALL_TABLES. It drops tables, but it seems inspector.get_table_names() does not read names directly from database, just uses cached version of database. I. e. model.__table__.name not in inspector.get_table_names() is False after a table is dropped. So, tables are not recreated and this causes errors.
It can be fixed in 2 ways:
Now I am using PostgreSQL and got some problems with options
SQLALCHEMYBACKEND_CLEAR_CONTENT
andSQLALCHEMYBACKEND_DROP_ALL_TABLES
when they are set toTrue
.These options are used in this function:
Let first talk about
CLEAR_CONTENT
option. It just not working, because commit is missing.Fixed version:
I also think that the session can be created only once, before loop (and committed and closed after).
Now about
DROP_ALL_TABLES
. It drops tables, but it seemsinspector.get_table_names()
does not read names directly from database, just uses cached version of database. I. e.model.__table__.name not in inspector.get_table_names()
isFalse
after a table is dropped. So, tables are not recreated and this causes errors.It can be fixed in 2 ways:
I choose 2nd way. Fixed version:
The text was updated successfully, but these errors were encountered: