Skip to content

Commit

Permalink
add migration to put settings into the Rocket.Chat Federation section
Browse files Browse the repository at this point in the history
  • Loading branch information
geekgonecrazy committed Apr 21, 2022
1 parent 8d07ef7 commit 8c3ab72
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions apps/meteor/server/startup/migrations/v261.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { addMigration } from '../../lib/migrations';
import { Settings } from '../../../app/models/server/raw';

addMigration({
version: 261,
async up() {
const settingsToFix = [
'FEDERATION_Enabled',
'FEDERATION_Status',
'FEDERATION_Domain',
'FEDERATION_Public_Key',
'FEDERATION_Discovery_Method',
'FEDERATION_Test_Setup'
];

const query = {
_id: { $in: settingsToFix },
};

await Settings.updateMany(query,
{
$set: {
section: 'Rocket.Chat Federation',
},
},
);
}
});

0 comments on commit 8c3ab72

Please sign in to comment.