Skip to content

Commit

Permalink
Removing unnecesary federation configs (#14674)
Browse files Browse the repository at this point in the history
  • Loading branch information
alansikora authored and sampaiodiego committed May 30, 2019
1 parent 484ee10 commit c178ddb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/startup/migrations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,6 @@ import './v142';
import './v143';
import './v144';
import './v145';
import './v146';
import './v147';
import './xrun';
22 changes: 22 additions & 0 deletions server/startup/migrations/v147.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Migrations } from '../../../app/migrations/server';
import { Settings } from '../../../app/models';

const validSettings = [
'FEDERATION_Discovery_Method',
'FEDERATION_Domain',
'FEDERATION_Enabled',
'FEDERATION_Hub_URL',
'FEDERATION_Public_Key',
'FEDERATION_Status',
'FEDERATION_Test_Setup',
];

Migrations.add({
version: 147,
up() {
Settings.remove({ $and: [{ _id: /FEDERATION/ }, { _id: { $nin: validSettings } }] });
},
down() {
// Down migration does not apply in this case
},
});

0 comments on commit c178ddb

Please sign in to comment.