Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Migration error

31 views
Skip to first unread message

Hugo

unread,
Nov 11, 2024, 10:12:15 AM11/11/24
to django-oscar
Hi,
I'm new with  oscar, and have some experience with django.
I want a marketplace, so the products are tied for each of the vendors.
In INSTALLED_APPS I added:
    'marketplace.apps.MarketplaceConfig',
    'marketplace.catalogue.apps.CatalogueConfig',
    'marketplace.dashboard.catalogue.apps.CatalogueDashboardConfig',
and the new model is:
"""
from django.db import models
from oscar.apps.catalogue.abstract_models import AbstractProduct
from django.contrib.auth.models import User


class Product(AbstractProduct):
    vendor = models.ForeignKey(User, on_delete=models.CASCADE, related_name='new-product')

    class Meta:
        verbose_name = 'New product'
        verbose_name_plural = 'New products'


from oscar.apps.catalogue.models import *  # noqa

"""
I don't know why do I have this error with the migrations:
"""
django.db.migrations.exceptions.NodeNotFoundError: Migration analytics.0002_auto_20140827_1705 dependencies reference nonexistent parent node ('catalogue', '0001_initial')
"""

I read something strange in the documentation, in:
https://docs.oscarcommerce.com/en/latest/howto/how_to_customise_models.html
said that:  "The recommended way to handle migrations is to copy the migrations directory from oscar/apps/catalogue into your new catalogue app."
so, must I create an app/marketplace/catalogue/migrations and copy all the migrations?, and what happends when oscar updates, isn't there any problems with this copy?
Message has been deleted

Aaron Jack

unread,
Nov 11, 2024, 10:20:38 AM11/11/24
to django-oscar
Yes - I copied the migrations directory into my project.

I haven't experienced any issues when updating, yet...

Hugo

unread,
Dec 24, 2024, 9:57:10 AM12/24/24
to django-oscar
Now I understand it, when use the fork command it copied the migrations files. So, you need them to work. And use the migrations specifying the app `python manage.py migrate marketplace`.

Thanks
Reply all
Reply to author
Forward
0 new messages