search

Home  >  Q&A  >  body text

python - flask sqlalchemy migrate how to ignore existing tables or fields

As the title states, when I upgrade, I get an error sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1060, "Duplicate column name 'period'") [SQL: u'ALTER TABLE text_template ADD COLUMN period INTEGER']

It seems to mean that the field already exists in this table. How to set it to ignore the existing table or field? Thanks

黄舟黄舟2757 days ago998

reply all(1)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-18 10:46:36

    You can manually modify the migrate file and remove existing fields.

    reply
    0
  • Cancelreply