Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

upgrading.rst 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ---------
  2. Upgrading
  3. ---------
  4. This document explains some of the issues that can be encountered whilst
  5. upgrading Oscar.
  6. .. note::
  7. Detailed upgrade instructions for specific releases can be found on the `Github
  8. wiki`_.
  9. .. _`Github wiki`: https://github.com/tangentlabs/django-oscar/wiki/Upgrading
  10. Migrations
  11. ----------
  12. Oscar uses South_ to provide migrations for its apps. But since Oscar allows
  13. an app to be overridden and its models extended, handling migrations can be
  14. tricky when upgrading.
  15. .. _South: http://south.readthedocs.org/en/latest/installation.html
  16. Suppose a new version of Oscar changes the models of the 'shipping' app and
  17. includes the corresponding migrations. There are two scenarios to be aware of:
  18. Migrating uncustomised apps
  19. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  20. Apps that you aren't customising will upgrade trivially as your project
  21. will pick up the new migrations from Oscar directly.
  22. For instance, if you have ``oscar.apps.core.shipping`` in your
  23. ``INSTALLED_APPS`` then you can simply run::
  24. ./manage.py migrate shipping
  25. to migrate your shipping app.
  26. Migrating customised apps
  27. ~~~~~~~~~~~~~~~~~~~~~~~~~
  28. For apps that you are customising, you need to create a new migration that picks
  29. up the changes in the core Oscar models::
  30. For instance, if you have an app ``myproject.shipping`` that replaces
  31. ``oscar.apps.shipping`` in your ``INSTALLED_APPS`` then you can simply run::
  32. ./manage.py schemamigration shipping --auto
  33. to create the appropriate migration.