File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 150150 "reflux" : " 0.4.1" ,
151151 "reflux-state-mixin" : " mongodb-js/reflux-state-mixin" ,
152152 "semver" : " ^5.1.0" ,
153- "storage-mixin" : " ^0.8.0 " ,
153+ "storage-mixin" : " ^0.8.1 " ,
154154 "tunnel-ssh" : " ^3.2.1-beta" ,
155155 "turf-destination" : " ^1.2.1" ,
156156 "turf-distance" : " ^1.1.0" ,
Original file line number Diff line number Diff line change 1+ const async = require ( 'async' ) ;
2+ const debug = require ( 'debug' ) ( 'mongodb-compass:migrations' ) ;
3+ const ConnectionCollection = require ( '../models/connection-collection' ) ;
4+
5+ /**
6+ * This migration removes and then re-saves all connections in order to trigger
7+ * the secureCondition of the "splice" storage backend again, which wasn't correctly
8+ * working in 1.4.1, see COMPASS-426.
9+ */
10+ function rewriteStoredConnections ( done ) {
11+ debug ( 'migration: rewriteStoredConnections' ) ;
12+ const connections = new ConnectionCollection ( ) ;
13+ connections . once ( 'sync' , function ( ) {
14+ connections . each ( function ( connection ) {
15+ // We destroy the connection and resave it to persist to the correct engine.
16+ if ( connection ) {
17+ connection . destroy ( ) ;
18+ connection . save ( ) ;
19+ }
20+ } ) ;
21+ done ( ) ;
22+ } ) ;
23+ connections . fetch ( { reset : true } ) ;
24+ }
25+
26+ module . exports = function ( previousVersion , currentVersion , callback ) {
27+ async . series ( [
28+ rewriteStoredConnections
29+ ] , function ( err ) {
30+ if ( err ) {
31+ return callback ( err ) ;
32+ }
33+ callback ( null , 'successful migration to remove plaintext passwords' ) ;
34+ } ) ;
35+ } ;
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ var migrations = {
88 '1.2.0' : require ( './1.2.0' ) ,
99 '1.3.0-beta.0' : require ( './1.3.0-beta.0' ) ,
1010 '1.3.0-beta.1' : require ( './1.3.0-beta.1' ) ,
11- '1.3.0-beta.3' : require ( './1.3.0-beta.3' )
11+ '1.3.0-beta.3' : require ( './1.3.0-beta.3' ) ,
12+ '1.5.0-beta.5' : require ( './1.5.0-beta.5' )
1213} ;
1314
1415var migrate = require ( 'app-migrations' ) ( migrations ) ;
You can’t perform that action at this time.
0 commit comments