But I have run makemigrations in the server, How to repair now? Should I 
delete all migrations files?

On Sunday, December 4, 2016 at 12:54:53 AM UTC+8, Vijay Khemlani wrote:
>
> If you are versioning your migration files (most liketly) then you don't 
> have to run makemigrations in the server again.
>
> On Fri, Dec 2, 2016 at 11:55 PM, zhangdb7 <zhan...@gmail.com <javascript:>
> > wrote:
>
>> Python 3.5, Django 1.10.3, Sqlite
>> I have deployed a django app in heroku.It ran without errors before. One 
>> day I make some change in models.py. I first do
>> python manage.py collectstatic,
>> python manage.py makemigrations,
>> python manage.py migrate,
>> heroku local web -f Procfile.windows,
>> the app run correctly in local. Then I push my codes to heroku. I ran:
>> git push heroku master
>> heroku run bash
>> $python manage.py makemigrations
>> $python manage.py migrate
>> heroku ps:scale web=1
>> But server returned:
>>
>>     ProgrammingError at /twitter/blog/
>>     column twitter_article.enable_comments does not exist
>>     LINE 1: ...article"."content", "twitter_article"."pub_date", "twitter_a.
>>
>> Here is my key model:
>>
>>     from django.db import models
>>     from fluent_comments.moderation import moderate_model,comments_are_open, 
>> comments_are_moderated
>>     from fluent_comments.models import get_comments_for_model, 
>> CommentsRelation
>>
>>     class Article(models.Model) :
>>     title = models.CharField(max_length = 100)
>>     category = models.CharField(max_length = 50, blank = True)
>>     pub_date = models.DateTimeField(auto_now_add = True)
>>     content = models.TextField(blank = True, null = True)
>>     pub_date = models.DateTimeField("pub_date")
>>     enable_comments = models.BooleanField("Enable comments", default=True)
>>
>>     def __str__(self) :
>>         return self.title
>>
>>     class Meta:
>>         ordering = ['-pub_date']
>>
>>     # Optional, give direct access to moderation info via the model:
>>     comments = property(get_comments_for_model)
>>     comments_are_open = property(comments_are_open)
>>     comments_are_moderated = property(comments_are_moderated)
>>
>>     # Give the generic app support for moderation by django-fluent-comments:
>>     moderate_model(Article,
>>         publication_date_field='pub_date',
>>         enable_comments_field='enable_comments',
>>     )
>>
>> If I drop my database and build a new database. Server won't report 
>> error. Why? I'm using sqlite.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com <javascript:>.
>> To post to this group, send email to django...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/014a79e8-57d4-45e2-88ff-eabbefd67153%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/014a79e8-57d4-45e2-88ff-eabbefd67153%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4ba51783-4545-4adb-8ba8-5c89b193ee02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to