Python 循环makemigrations/migrate问题:没有要应用的迁移
我在部署到Heroku的Django 1.8应用程序上有这个模型。当我运行“makemigrations”时,我得到:Python 循环makemigrations/migrate问题:没有要应用的迁移,python,django,postgresql,heroku,Python,Django,Postgresql,Heroku,我在部署到Heroku的Django 1.8应用程序上有这个模型。当我运行“makemigrations”时,我得到: Migrations for 'account': 0002_auto_20150412_1337.py: - Alter field email on emailaddress Migrations for 'socialaccount': 0002_auto_20150412_1337.py: - Alter field provider on so
Migrations for 'account':
0002_auto_20150412_1337.py:
- Alter field email on emailaddress
Migrations for 'socialaccount':
0002_auto_20150412_1337.py:
- Alter field provider on socialaccount
- Alter field provider on socialapp
但当我运行“迁移”时,我得到了以下信息:
Operations to perform:
Synchronize unmigrated apps: messages, allauth, staticfiles, facebook
Apply all migrations: accounts, sites, auth, socialaccount, account, admin, contenttypes, sessions
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
No migrations to apply.
Your models have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
我以前在为1.6构建一个类似的应用程序时遇到过这个问题,然后我通过假装第一次迁移解决了这个问题。不过,这一次似乎行不通
from django.db import models
from django.contrib.auth.models import User
from allauth.account.signals import user_signed_up
from django.dispatch import receiver
from appname import settings
class UserProfile(models.Model):
user = models.OneToOneField(User, related_name='profile')
age = models.IntegerField(null = True)
location = models.CharField(max_length = 50, null = True, default ="")
display_name = models.CharField(max_length = 50, null = True, default ="")
updated_profile = models.BooleanField(default = False)
rating_access = models.BooleanField(default = False)
rating = models.IntegerField(default = 0)
seen_introduction = models.BooleanField(default = False)
def __unicode__(self):
return "%s profile. Age: %s, Location: %s" % (self.user.username, self.age, self.location)
@receiver(user_signed_up)
def new_user_signup(sender, **kwargs):
p = UserProfile(user = kwargs['user'])
p.save()
你能检查这两个迁移文件是否都是Django实际创建和可读的吗?应用程序部署在Heroku上(更新了问题以反映这一点),我无法控制权限。你可以查看文件是否存在以及权限是什么?您是否在本地创建迁移并将其推送到Heroku?我相信我见过一些人在尝试在Heroku上创建迁移时遇到问题。@knbk我也遇到了同样的错误。“socialaccount”的多个迁移文件是这样生成的:0013_auto_20160513_1224.py:-在socialaccount上更改字段提供程序-在socialapp上更改字段提供程序您能提供帮助吗??