Migration issue and fix for master: Unknown column

410 views
Skip to first unread message

Robert Raposa

unread,
Sep 22, 2016, 3:43:44 PM9/22/16
to edx-...@googlegroups.com
A migration was reverted from master during the last release.  If you run into the following error:

(1054, "Unknown column 'commerce_commerceconfiguration.receipt_page' in 'field list'")

You can do the following:
  • git checkout 777964b9aae8a679fc4edef0d8186910777bd560
  • ./manage.py lms --settings=devstack migrate commerce 0004
    • Answer "yes" when prompted.
  • git checkout master (or wherever you were)
Thanks to Eric Fischer for the fix.

--

Robert Raposa

edX | Software Architect  | rra...@edx.org  

141 Portland Street, 9th floor

Cambridge, MA 02139

http://www.edx.org

http://www.e-learn.nl/media/blogs/e-learn/edX_Logo_Col_RGB_FINAL.jpg?mtime=1336074566

mje...@edx.org

unread,
Sep 27, 2016, 9:38:48 AM9/27/16
to General Open edX discussion
The 2nd error that occurs for the same reason is:

(1364, "Field 'receipt_page_url' doesn't have a default value")

It happened to me when I tried to add a SiteConfiguration object. I did the following to fix it:

  • git checkout 777964b9aae8a679fc4edef0d8186910777bd560
  • ./manage.py lms --settings=devstack migrate site_configuration 0002
    • Answer "yes" when prompted.
  • git checkout master (or wherever you were)

Daniel

unread,
Nov 12, 2016, 12:00:24 PM11/12/16
to General Open edX discussion
when im trying to do git checkout im getting that this code is not a git id or something else. please help me.

четверг, 22 сентября 2016 г., 22:43:44 UTC+3 пользователь Robert R написал:

mje...@edx.org

unread,
Nov 14, 2016, 2:58:16 AM11/14/16
to General Open edX discussion
Can you copy/paste the exact error you're getting?

Also, did you run a git fetch to get all the branches from the remote repository?

I ran the git checkout locally and it works for me.

Daniel

unread,
Nov 15, 2016, 7:32:42 AM11/15/16
to General Open edX discussion
Im using openedx ver open-release/eucalyptus.2 in production, i have 2 servers 1-master, 2-eucalyptus.2

i want to migrate databases from 1 to 2, when im trying to use this solution im getting an error that  
edxapp@v7360:~/edx-platform$ ./manage.py lms --settings=aws makemigrations commerce 0004
Traceback (most recent call last):
  File "./manage.py", line 111, in <module>
    startup = importlib.import_module(edx_args.startup)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/edx/app/edxapp/edx-platform/lms/startup.py", line 21, in <module>
    import lms_xblock.runtime
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/lms_xblock/runtime.py", line 11, in <module>
    from openedx.core.djangoapps.user_api.course_tag import api as user_course_tag_api
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/user_api/course_tag/api.py", line 10, in <module>
    from ..models import UserCourseTag
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/user_api/models.py", line 20, in <module>
    from student.models import UserProfile, Registration, PendingEmailChange  # pylint: disable=unused-import
  File "/edx/app/edxapp/edx-platform/common/djangoapps/student/models.py", line 51, in <module>
    from certificates.models import GeneratedCertificate
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/certificates/__init__.py", line 3, in <module>
    from . import signals
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/certificates/signals.py", line 7, in <module>
    from certificates.models import CertificateGenerationCourseSetting
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/certificates/models.py", line 70, in <module>
    from util.milestones_helpers import fulfill_course_milestone, is_prerequisite_courses_enabled
  File "/edx/app/edxapp/edx-platform/common/djangoapps/util/milestones_helpers.py", line 14, in <module>
    from milestones.services import MilestonesService
ImportError: No module named services

could you help me?

mje...@edx.org

unread,
Nov 15, 2016, 8:22:01 AM11/15/16
to General Open edX discussion
Don't run makemigrations because you don't want to create a new migration, instead you want to revert to the 0004 migration found within commerce application.
See if that's what's causing the problem.

Also, try removing all the *.pyc files when you're moving between two branches that are of different versions.
The following command should help:

find . -name '*.pyc' -delete
Reply all
Reply to author
Forward
0 new messages