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

(SP: 5) Migration Task: Remove Fields from Quiz and Update Cooperations #1058

Closed
Mike-Popovych opened this issue Dec 10, 2024 · 1 comment · May be fixed by #1067
Closed

(SP: 5) Migration Task: Remove Fields from Quiz and Update Cooperations #1058

Mike-Popovych opened this issue Dec 10, 2024 · 1 comment · May be fixed by #1067
Assignees

Comments

@Mike-Popovych
Copy link
Contributor

image

Description

This task involves updating the quiz and cooperations collections in the database. Specifically:

  1. Remove the resourceType field from the quiz collection and migrate it to the corresponding cooperations documents.
  2. Remove the availability field from the quiz collection and migrate it to the corresponding cooperations documents.
  3. If no corresponding cooperations document is found for a quiz, the fields will be removed without adding them to cooperations.

Tasks

  1. Analyze Data:

    • Verify that all documents in the cooperations collection contain a resourceId field referencing a valid _id in the quiz collection.
    • Ensure that removing the availability and resourceType fields from the quiz collection does not affect dependent functionality.
  2. Update cooperations:

    • For each document in the quiz collection:
      • Check if a corresponding document exists in the cooperations collection (match by resourceId).
      • If a match is found:
        • Add the resourceType field to the cooperations document with the appropriate value ("quiz" or other relevant value).
      • If no match is found:
        • Skip updating cooperations.
  3. Remove Fields from lessons:

    • Remove the resourceType field from all documents in the quiz collection.
    • Remove the availability field from all documents in the quiz collection.
  4. Testing:

    • Validate that:
      • The resourceType field is correctly added to the cooperations collection where applicable.
      • The resourceType and availability fields are removed from all documents in the quiz collection.
      • Documents in the quiz collection without a matching cooperations document only have the fields removed.
  5. Code Implementation:

    • Write a migration script that:
      • Checks for a corresponding cooperations document for each quiz.
      • Adds resourceType to cooperations if a match is found.
      • Removes resourceType and availability from quiz regardless of whether a match is found.
  6. Testing Automation:

    • Write automated tests to verify:
      • Correct updates to cooperations where matches exist.
      • Correct removal of resourceType and availability from quiz.
      • Handling of quiz without a matching cooperations document.
@github-project-automation github-project-automation bot moved this to Project Backlog in SpaceToStudy Dec 10, 2024
@PavloButynets PavloButynets self-assigned this Dec 10, 2024
@PavloButynets PavloButynets moved this from Project Backlog to Sprint Backlog in SpaceToStudy Dec 17, 2024
@ArtemHolikov ArtemHolikov changed the title (SP:) Migration Task: Remove Fields from Quiz and Update Cooperations (SP: 5) Migration Task: Remove Fields from Quiz and Update Cooperations Dec 17, 2024
@Mike-Popovych Mike-Popovych closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
@github-project-automation github-project-automation bot moved this from Sprint Backlog to Done in SpaceToStudy Dec 19, 2024
@Mike-Popovych
Copy link
Contributor Author

not relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
2 participants