यह मेरा models.py है:माइग्रेट करने का प्रयास करते समय "निम्न सामग्री प्रकारों को बाँधना और हटाया जाना चाहिए" प्राप्त करना। इसका क्या अर्थ है, और मैं इसे कैसे हल कर सकता हूं?
Migrations for 'CApp':
0019_auto_20151202_2228.py:
- Create model RegularNotification
- Create model FNotification
- Remove field user from notification
- Add field f_request to userextended
- Delete model Notification
सबसे पहले, यह है कि यह कहते हैं Remove field user from notification
क्योंकि user
अभी भी मेरे Notiication
मॉडल में है अजीब है:
class Notification(models.Model):
user = models.ForeignKey(User)
createdAt = models.DateTimeField(auto_now_add=True, blank=True)
read = models.BooleanField(default=False, blank=True)
class Meta:
abstract = True
class RegularNotification(Notification):
message = models.CharField(max_length=150)
link = models.CharField(max_length=100)
class FNotification(Notification):
# same as Notification
pass
जब मैं python manage.py makemigrations
करते हैं, यह यह क्या कहते है (इसलिए यदि कोई यह समझ सकता है कि यह क्यों कहता है कि 'फ़ील्ड उपयोगकर्ता को अधिसूचना से हटा रहा है', तो यह बहुत अच्छा होगा!) लेकिन फिर भी, जब मैं आगे बढ़ता हूं और python manage.py migrate
करने का प्रयास करता हूं तो मुझे यह संदेश मिलता है:
Applying CMApp.0019_auto_20151202_2228... OK
The following content types are stale and need to be deleted:
CApp | notification
Any objects related to these content types by a foreign key will also
be deleted. Are you sure you want to delete these content types?
If you're unsure, answer 'no'.
Type 'yes' to continue, or 'no' to cancel: no
मैंने no
टाइप किया। लेकिन इसका क्या अर्थ है, मुझे यह संदेश क्यों मिल रहा है और मैं इसे कैसे बना सकता हूं ताकि मुझे इस संदेश की आवश्यकता न हो?
मुझे यह मिला क्योंकि मैं भंडार की अंतिम प्रतिबद्धता को खींचना भूल गया था। मेरा नवीनतम स्थानीय प्रवास भंडार में नवीनतम नहीं था। : पी मैंने रिमोट कोड खींचा, मैंने फिर से माइग्रेशन किया और मैंने एक आकर्षण की तरह काम किया। – joaorodr84