I have updated some fields of a table in my database by removing a field and adding some, as well as adding a new table. I run:
python manage.py makemigrations
python manage.py migrate
And I get no changes detected and no changes were applied.
In django admin I don't see the new table and when I click add a new record into the database it displays the old fields. This is also reflected in the database as it displays the old fields and not the new table.
I have dropped all tables in the database and deleted all migrations in each app leaving init.py and I still get this error which confuses me because how can it show old fields which I have deleted and there are no record of as I have deleted the table and migrations?
The code in question:
from __future__ import unicode_literals
from django.db import models
from src.profiles.models import Profiles
# Create your models here.
class Product(models.Model):
name = models.CharField(max_length=200, primary_key=True)
description = models.CharField(max_length=1000)
price = models.DecimalField(max_digits=10, decimal_places=2)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
def __str__(self):
return self.name
class ProductsOwned(models.Model):
ownedID = models.ForeignKey(Profiles.user)
product = models.ForeignKey(Product.name)
purchaseDate = models.DateTimeField(auto_now=True)
expiryDate = models.DateTimeField()
def __str__(self):
return self.name
If you need any clarification or have any questions please ask.
Edit: I can literally delete all my code in the models and no changes will still be detected.
Edit 2: Make migrations code uploaded to a pastebin: http://pastebin.com/GywuiCZj
Edit 3: The app I am editing is catalog, my installed apps:
INSTALLED_APPS = [
'profiles',
'contact',
'crispy_forms',
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'stripe',
'checkout',
'catalog',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]