I have this models:
class Genre(models.Model):
genre = models.CharField(max_length=100)
def __str__(self):
return self.genre
class Book(models.Model):
book_name = models.CharField(max_length=150)
summary = models.TextField(max_length=1000, null=True,blank=True)
author = models.ForeignKey('Author', on_delete=models.CASCADE)
genre = models.ManyToManyField(Genre)
status = [
('a', 'available'),
('b', 'borrowed'),
('r', 'reserved'),
]
book_status = models.CharField(max_length=1, choices=status, default='a')
def __str__(self):
return '{0}({1})'.format(self.book_name, self.author)
def get_absolute_url(self):
return reverse('main_app:book-detail', args=[self.id])
class Author(models.Model):
first_name = models.CharField(max_length=200)
last_name = models.CharField(max_length=200)
rate = models.IntegerField(default=0)
def __str__(self):
return '{0} {1}'.format(self.first_name,self.last_name)
and i deleted an uuidfield from book table...
then i deleted this file -> 0001_initial.py
and then run : py manage.py makemigrations and migrate
but migrate is not available to recognize the changes :
C:\Users\amir\Documents\GitHub\simple_library> py manage.py makemigrations
Migrations for 'main_app':
main_app\migrations\0001_initial.py
- Create model Author
- Create model Book
- Create model Genre
- Add field genre to book
C:\Users\amir\Documents\GitHub\simple_library> py manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, main_app, sessions
Running migrations:
No migrations to apply.
what should i do now?
--
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 [email protected].
To post to this group, send email to [email protected].
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/CAPgudTetbg4a27E-sJD-uqZgdiEtXd4-UrGOK79Herkyqns-Eg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.