Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛(edx) fix mysql seeding script for development #40

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wilbrdt
Copy link
Contributor

@wilbrdt wilbrdt commented Oct 18, 2024

Purpose

  1. The relationships in the student_manualenrollmentaudit are incorrect.
  2. Since the introduction of the edx MySQL models, the seeding script has stopped working.

Proposal

  1. The student_manualenrollmentaudit table is a child of the student_coursenrollment table, which is a child of the auth_user table. When a user is deleted, Mork should delete the corresponding enrollments and the corresponding manual enrollment audits. We don't want to delete based on the enrolled_by field
  2. We rely on factories to generate fake data into the MySQL development database. To ensure compatibility with both testing and seeding use cases, the factories need some proper configuration, mainly on handling the session and the persistency.
    Additionally, subfactories were used to cascade factory creation, which works in tests but fails when committing to a real development database. These subfactories have been replaced with factoryboy related factories to resolve the issue.

The `student_manualenrollmentaudit` table is a child of the
`student_coursenrollment` table, which is a child of the `auth_user` table.
When a user is deleted, Mork should delete the corresponding enrollments and
the corresponding manual enrollment audits.
We don't want to delete based on the `enrolled_by` field.
Since the introduction of the edx MySQL models, the seeding script has stopped
working.
We rely on factories to generate fake data into the MySQL development database.
To ensure compatibility with both testing and seeding use cases, the factories
need some proper configuration, mainly on handling the session and the
persistency.
Additionally, subfactories were used to cascade factory creation, which works
in tests but fails when committing to a real development database. These
subfactories have been replaced with factoryboy related factories to resolve the
issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant