diff --git a/meet-ce/backend/src/config/internal-config.ts b/meet-ce/backend/src/config/internal-config.ts index 818e147d..15e867aa 100644 --- a/meet-ce/backend/src/config/internal-config.ts +++ b/meet-ce/backend/src/config/internal-config.ts @@ -54,11 +54,13 @@ 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, - API_KEY_SCHEMA_VERSION: 1 as SchemaVersion, - ROOM_SCHEMA_VERSION: 1 as SchemaVersion, - RECORDING_SCHEMA_VERSION: 1 as SchemaVersion + // IMPORTANT: whenever you increment a schema version, update the MIGRATION_REV timestamp too. + // This helps surface merge conflicts when multiple branches create schema migrations concurrently. + GLOBAL_CONFIG_SCHEMA_VERSION: 1 as SchemaVersion, // MIGRATION_REV: 1771328577054 + USER_SCHEMA_VERSION: 1 as SchemaVersion, // MIGRATION_REV: 1771328577054 + API_KEY_SCHEMA_VERSION: 1 as SchemaVersion, // MIGRATION_REV: 1771328577054 + ROOM_SCHEMA_VERSION: 1 as SchemaVersion, // MIGRATION_REV: 1771328577054 + RECORDING_SCHEMA_VERSION: 1 as SchemaVersion // MIGRATION_REV: 1771328577054 }; // This function is used to set private configuration values for testing purposes. diff --git a/meet-ce/backend/src/migrations/README.md b/meet-ce/backend/src/migrations/README.md index 4580e468..d0f96962 100644 --- a/meet-ce/backend/src/migrations/README.md +++ b/meet-ce/backend/src/migrations/README.md @@ -76,17 +76,25 @@ export interface MeetRoom extends MeetRoomOptions { ### Step 2: Update Schema Version in Configuration -In `src/config/internal-config.ts`, increment the version constant: +In `src/config/internal-config.ts`, increment the version constant and update the `MIGRATION_REV` timestamp comment on the same line: ```typescript // internal-config.ts export const INTERNAL_CONFIG = { // ... other config - ROOM_SCHEMA_VERSION: 2 // Was 1 + ROOM_SCHEMA_VERSION: 2 as SchemaVersion // MIGRATION_REV: 1771328577054 // ... }; ``` +`MIGRATION_REV` is a unique marker (current timestamp in milliseconds) used to make concurrent schema-version bumps more visible during Git merges. + +If a merge conflict appears in that line, it means multiple migrations were created in parallel; resolve it by: + +1. Keeping all migration code changes. +2. Re-evaluating the final schema version number. +3. Updating `MIGRATION_REV` again with a new timestamp. + ### Step 3: Update Moongose Schema Update the Mongoose schema to reflect the changes (new fields, etc.):