[外键约束问题]django.db.utils.IntegrityError: (1215, 'Cannot add foreign key constraint')

[外键约束问题]django.db.utils.IntegrityError: (1215, 'Cannot add foreign key constraint')_第1张图片

[外键约束问题]django.db.utils.IntegrityError: (1215, 'Cannot add foreign key constraint')

DATABASES= {

    'default': {

        'ENGINE': 'django.db.backends.mysql',

        'NAME': 'ebusiness',

        'USER':'root',

        'PASSWORD':'123456',

        'HOST':'localhost',

        'PORT':'3306',

        'OPTIONS': {

            "init_command": "SET foreign_key_checks = 0;",

        }#加入这个在setting.py文件中数据库配置信息中

        #'OPTIONS':{'init_command':'SET engine=InnoDB',},

    }

}

你可能感兴趣的:([外键约束问题]django.db.utils.IntegrityError: (1215, 'Cannot add foreign key constraint'))