Cannot complete Flask-Migration

后端 未结 8 2158
刺人心
刺人心 2021-02-02 13:27

I\'ve setup a local Postgres DB with SQLAlchemy and cannot commit my first entry. I keep on getting this error...

ProgrammingError: (ProgrammingError) relation          


        
8条回答
  •  暖寄归人
    2021-02-02 14:01

    It means that the entry in table alembic_version of your db is "39408d6b248d" and there's no migration file related to it in migrations folder (by default migrations/versions).

    So better drop the table alembic_version from your db and do

    $ python app.py db history to get the new head of migrations, say, 5301c31377f2

    Now run $ python app.py db stamp 5301c31377f2 to let alembic know that it's your migration head (which gets stored in table alembic_version).

提交回复
热议问题