简体   繁体   中英

psycopg2.ProgrammingError: column cons.consrc does not exist

I am working on a web app where I needed to update the Postgres(12) database. I am using flask-migrate for the purpose.

I have tried to fix it, but it seems it is a new issue and hence I am not getting much help. I have tried to modify the database from my terminal, that works obviously. This is what I usually type to update my db:

flask db migrate -m ".."

This is the error message I am receiving at the terminal:

psycopg2.ProgrammingError: column cons.consrc does not exist
LINE 4:                 cons.consrc as src
                        ^
HINT:  Perhaps you meant to reference the column "cons.conkey" or the column "cons.conbin".

Are you using SQLAlchemy? And if yes, which version? Version 1.3.10 fixed the problem for me. Hope it helps.

I got the same error after upgrading to Postgres v12.

I did:

pip install --upgrade sqlalchemy 

and upgrade any other dependency packages working together with sqlalchemy, for example, pip install --upgrade vdm

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM