makemigrations

Mezzanine/Django 1.10 migrations: Database tables does not much with migrations

≯℡__Kan透↙ 提交于 2019-12-12 03:45:12
问题 I am using Mezzanine (Django 1.10) so I can't see a " db.sqlite3 " I searched similar questions as mine and most of the solutions provided were not effective. I created a new model and later decided to add a new field. I did "python manage.py makemigrations ", and when I looked at my migrations folder, it's there; the new field exists. Now, when I ran the app and looked into admin, it gave me error where it said "No such column exists". Therefore, I think, my database is not synced with the

Django makemigrations No changes detected in app

佐手、 提交于 2019-12-11 05:31:57
问题 I have trouble with my makemigrations command. Note: I have successfully make migrations till now, so it is not the first time I try to make migrations on this project. I have my project in INSTALLED_APPS. Problem: For some reason project stop detecting any changes in my models. Inside my project models.py I have: from myproject.myfolder import myModel1 from myproject.myfolder import myModel2 from myproject.myfolder import myModel3 if a add new models as myModel4 class and import it inside

Django 1.10 - makemigrations command not detecting changes for unmanaged models

旧巷老猫 提交于 2019-12-07 19:41:28
问题 Thanks in advance for your help. Inside mi project I have an app involving models that were generated from an existing database. As those tables are administered by a DBA, they are kept as unmanaged models. As it is possible that we require to re-generate the models from db due to changes in the schema, we have created alternative proxy models for each of those models to decouple the part that we manage from what we don't. Below you can see an example based on our current layout. The example

Django migrations : relation already exists

匆匆过客 提交于 2019-12-06 13:29:38
问题 I have trouble with django model migrations. I have some models in my app, and I already have some data inside. When I added some models in my application, and I run makemigrations , the app report that there is no change. I know that sometimes some errors came when migrate, so I delete django_migrations table in my database and run makemigrations again, and now program found my new fields. The problem now is that if I run migrate system tell me that some tables already exist. (Which is ok

Django-polymorphic models having issues making migrations on 1.7

不打扰是莪最后的温柔 提交于 2019-12-06 03:42:49
I am using Django 1.7 and django-polymorphic for my models class ReferenceItem(PolymorphicModel): created_at = models.DateTimeField(_('date created'), auto_now_add=True, db_index=True) updated_at = models.DateTimeField(_('date modified'), auto_now=True, db_index=True) uuid = UUIDField(auto=True, unique=True) description = models.CharField(max_length=255) class OrderItem(ReferenceItem): order = models.ForeignKey('Order', related_name='items') sku = models.CharField(max_length=255) quantity = models.IntegerField() unit_price = models.DecimalField(max_digits=10, decimal_places=2) amount = models

Django migrations : relation already exists

丶灬走出姿态 提交于 2019-12-04 20:33:33
I have trouble with django model migrations. I have some models in my app, and I already have some data inside. When I added some models in my application, and I run makemigrations , the app report that there is no change. I know that sometimes some errors came when migrate, so I delete django_migrations table in my database and run makemigrations again, and now program found my new fields. The problem now is that if I run migrate system tell me that some tables already exist. (Which is ok and correct, because they do). I don't want to delete those tables, because I have data already inside. I

Django - no such table exception

雨燕双飞 提交于 2019-11-30 09:18:57
In Django, I've added some models into models.py . After manage.py makemigrations , manage.py migrate raised this exception: django.db.utils.OperationalError: no such table: auth_test_usertranslatorprofile So I've removed all old migrations and run makemigrations and migrate again which seemed to work. Unfortunately, I've noticed that it didn't helped because when I try to click on User customer profiles of User translator profiles it raises exception: Environment: Request Method: GET Request URL: http://127.0.0.1:8000/admin/auth_test/usertranslatorprofile/ Django Version: 1.8.7 Python Version

Django - no such table exception

纵然是瞬间 提交于 2019-11-29 07:53:51
问题 In Django, I've added some models into models.py . After manage.py makemigrations , manage.py migrate raised this exception: django.db.utils.OperationalError: no such table: auth_test_usertranslatorprofile So I've removed all old migrations and run makemigrations and migrate again which seemed to work. Unfortunately, I've noticed that it didn't helped because when I try to click on User customer profiles of User translator profiles it raises exception: Environment: Request Method: GET Request