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
- get the tab number
- get the room id from the Message
- get the Room's array of tabs using the room _id
- get the tab id using the tab number (index)
- replace the tab number with the tab _id