DatabaseError: value too long for type character varying(100)

后端 未结 11 419
北恋
北恋 2021-01-31 02:37

I have a Django web site running a mini CMS we\'ve built internally years ago, it\'s using postgresql. When saving a simple title and a paragraph of text I get the following err

11条回答
  •  有刺的猬
    2021-01-31 03:27

    i went through this same error. and when i made changes in the modele, i kept having the same error.

    Here is how i fixed it. It might be necessary to skip few migrations for the program to only use the migration where changes have been made for the CharField max_lenght.

    for that you have to run

    python manage.py showmigrations 
    

    to see which migrations have not been made.

    then you skip them until you get to the last with the command

    python manage.py migrate  000_migration_number --fake 
    

提交回复
热议问题