Skip to content

db migration for messages with a reference #237

@okputadora

Description

@okputadora

Messages have a field called reference.
Reference has a field called tab which previously was a Number indicating the index of the tab in the Room's array of tabs. Currently we are storing the tabId. For old references to work we need to migrate Message.reference.tab from Number to ObjectId.
To get the correct id we would

  1. get the tab number
  2. get the room id from the Message
  3. get the Room's array of tabs using the room _id
  4. get the tab id using the tab number (index)
  5. replace the tab number with the tab _id

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions