我有一个全新的MariaDB服务(版本:5.5.41-MariaDB),并为我的Django(1.8.2)应用程序创建了一个新的数据库。数据库默认使用innoDB创建。Django迁移:无法创建表errno:150
我有一个模式,看起来像这样:
class UserProfile(models.Model):
user = models.OneToOneField(User, unique=True) # django's default user model
当我运行python manage.py 迁移。我收到以下错误:
File "/home/vagrant/envs/leo/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
self.errorhandler(self, exc, value)
File "/home/vagrant/envs/leo/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.OperationalError: (1005, "Can't create table 'leo.#sql-bcd_1f' (errno: 150)").
我在做什么错,我该如何解决?
看看我的答案在 http://stackoverflow.com/questions/29447863/django-mysql-error-creating-tables/37397470#37397470 也许有人可以用我的建议 – serguitus