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: Update the old cooperations according to the current scheme #1078

Open
PavloButynets opened this issue Dec 20, 2024 · 0 comments

Comments

@PavloButynets
Copy link

PavloButynets commented Dec 20, 2024

  1. Delete all cooperations that contain a non-existent initiator or receiver
  2. In old cooperations where the proficiencyLevel field is of type [string], change the type to string:
    • if the array contains one element, then just convert it to string
    • if there are several, then take the average value
  3. Delete fields:
    • category
    • subject
    • languages
  4. Add fields:
    • title
    • section (type: [Object])
      • If the sections field is present, it must conform to the current structure:
      sections:[
      {
        title: { type: String, required: true },
        description: { type: String, required: true },
        resources: [
          {
            resource: { type: Schema.Types.ObjectId, required: true },
            resourceType: { type: String },
            availability: { status: { type: String }, date: { type: Date } },
            completionStatus: { type: String }
          }
        ]
       }
      ]
      
  5. Rename the description field to additionalInfo

Testing
Write tests that check the correctness of migration:

  1. Testing the removal of cooperations with non-existent initiator or receiver
  2. Correct creation of title and section fields in documents where there is no such field
  3. Checking the absence of category, subject languages ​​and description fields after migration
  4. Checking the presence of additionalInfo fields in all documents
  5. MOST IMPORTANT: A test that checks whether the migration changes only the incorrect documents and does not affect the correct or all documents
@PavloButynets PavloButynets changed the title Migration task: Update the old cooperations according to the current scheme (SP:5) Migration task: Update the old cooperations according to the current scheme Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant