refactor: switch to use openedx_content app (#37924)

The openedx-learning repo was recently refactored to consolidate its
authoring apps into a single openedx_content app:

  https://github.com/openedx/openedx-platform/pull/37924

This commit makes the following changes to accommodate this:

- Bumps the openedx-learning version to 0.31.0 to get the changes.
- Creates new migrations in content_libraries, contentstore, and
  modulestore_migrator to foreign key references to authoring apps
  to point to the new openedx_content app. This is done without
  actually making database changes, since the openedx_content app
  models are taking over the existing tables that the authoring apps
  once pointed to.
- Creates new squashed migrations in these apps that create these
  foreign keys to reference openedx_content app models from the start.

The full rationale for how and why this was done is in the following
openedx-learning ADR:

  https://github.com/openedx/openedx-learning/blob/main/docs/decisions/0020-merge-authoring-apps-into-openedx-content.rst

These migrations should run fine from either a from-scratch scenario
(i.e. a new install or CI), or when upgrading from an Ulmo-or-later
database state. If you have a database state that comes from the middle
of the Ulmo development cycle (e.g. October 2025), you may encounter
migration errors in content_libraries, contentstore, or
modulestore_migrator, with an error message complaining about missing
tables. If you receive this message, run the following command:

  python manage.py lms migrate openedx_content 0001

Then try to run the migrations for the app that failed. Repeat if
necessary for multiple apps.
This commit is contained in:
David Ormsbee
2026-02-04 12:41:13 -05:00
committed by GitHub
parent b6904be3a4
commit 9bf7a72a3a
13 changed files with 541 additions and 21 deletions

View File

@@ -60,6 +60,7 @@ from enterprise.constants import (
PROVISIONING_PENDING_ENTERPRISE_CUSTOMER_ADMIN_ROLE,
DEFAULT_ENTERPRISE_ENROLLMENT_INTENTIONS_ROLE,
)
from openedx_learning.api.django import openedx_learning_apps_to_install
from openedx.core.lib.derived import Derived
from openedx.envs.common import * # pylint: disable=wildcard-import
@@ -2019,14 +2020,8 @@ INSTALLED_APPS = [
'openedx_events',
# Learning Core Apps, used by v2 content libraries (content_libraries app)
"openedx_learning.apps.authoring.collections",
"openedx_learning.apps.authoring.components",
"openedx_learning.apps.authoring.contents",
"openedx_learning.apps.authoring.publishing",
"openedx_learning.apps.authoring.units",
"openedx_learning.apps.authoring.subsections",
"openedx_learning.apps.authoring.sections",
# Learning Core apps that power libraries
*openedx_learning_apps_to_install(),
]
# Add LMS specific optional apps