backend: update schema versions and add schemaVersion field to MeetRoomMember schema

This commit is contained in:
juancarmore 2026-01-07 12:30:42 +01:00
parent 92b99764b9
commit b017334976
2 changed files with 10 additions and 3 deletions

View File

@ -48,10 +48,11 @@ export const INTERNAL_CONFIG = {
// MongoDB Schema Versions
// These define the current schema version for each collection
// Increment when making breaking changes to the schema structure
GLOBAL_CONFIG_SCHEMA_VERSION: 1 as SchemaVersion,
USER_SCHEMA_VERSION: 1 as SchemaVersion,
GLOBAL_CONFIG_SCHEMA_VERSION: 2 as SchemaVersion,
USER_SCHEMA_VERSION: 2 as SchemaVersion,
API_KEY_SCHEMA_VERSION: 1 as SchemaVersion,
ROOM_SCHEMA_VERSION: 1 as SchemaVersion,
ROOM_SCHEMA_VERSION: 2 as SchemaVersion,
ROOM_MEMBER_SCHEMA_VERSION: 1 as SchemaVersion,
RECORDING_SCHEMA_VERSION: 1 as SchemaVersion
};

View File

@ -1,5 +1,6 @@
import { MeetRoomMember, MeetRoomMemberRole } from '@openvidu-meet/typings';
import { Document, Schema, model } from 'mongoose';
import { INTERNAL_CONFIG } from '../../config/internal-config.js';
/**
* Mongoose Document interface for MeetRoomMember.
@ -53,6 +54,11 @@ const MeetRoomMemberPartialPermissionsSchema = createPermissionsSchema(false);
*/
const MeetRoomMemberSchema = new Schema<MeetRoomMemberDocument>(
{
schemaVersion: {
type: Number,
required: true,
default: INTERNAL_CONFIG.ROOM_MEMBER_SCHEMA_VERSION
},
memberId: {
type: String,
required: true