Django migrations 1215, 'Cannot add foreign key constraint'
当执行pythonmanage.pymigrations报错django.db.utils.IntegrityError:(1215,'Cannotaddforeignkeyconstraint'),外键约束问题。执行pythonmanage.pymigrate创建数据库表时出现的问题,后来看Djangodocumentmigrations,找到原因。我在models.py中定义了一个User表,