feat: add migrate-mongo#864
feat: add migrate-mongo#864Anushtha-Rathore wants to merge 1 commit intoWalkover-Web-Solution:testingfrom
Conversation
There was a problem hiding this comment.
Other comments (1)
- package.json (21-21) The `dockerStart` script should be updated to include MongoDB migrations since we're now adding support for MongoDB migrations. Consider adding `&& migrate-mongo up` to the dockerStart script to ensure MongoDB migrations are also applied during container startup.
💡 To request another review, post a new comment with "/windsurf-review".
| }, | ||
|
|
||
| // Point to the folder you already created! | ||
| migrationsDir: "migrations/mongo", |
There was a problem hiding this comment.
The configuration references a migrations/mongo directory, but this directory doesn't appear to be included in the PR. Make sure to create this directory structure or the migration tool will fail when attempting to read/write migrations.
| options: { | ||
| useNewUrlParser: true, // removes a deprecation warning when connecting | ||
| useUnifiedTopology: true // removes a deprecating warning when connecting | ||
| } |
There was a problem hiding this comment.
The MongoDB driver options useNewUrlParser and useUnifiedTopology are deprecated and no longer needed with MongoDB Node.js driver 4.0.0 and above. These options are now default behavior and can be safely removed.
| options: { | |
| useNewUrlParser: true, // removes a deprecation warning when connecting | |
| useUnifiedTopology: true // removes a deprecating warning when connecting | |
| } | |
| options: { | |
| // MongoDB driver 4.0+ uses these options by default | |
| } |
| // Enable the algorithm to create a checksum of the file contents and use that in the comparison to determine | ||
| // if the file should be run. Requires that scripts are coded to be run multiple times. | ||
| useFileHash: false, |
There was a problem hiding this comment.
Consider enabling useFileHash for better migration safety. When set to true, migrate-mongo will create a checksum of each migration file and only re-run it if the content hasn't changed. This helps prevent accidental re-runs of migrations when files are modified.
| // Enable the algorithm to create a checksum of the file contents and use that in the comparison to determine | |
| // if the file should be run. Requires that scripts are coded to be run multiple times. | |
| useFileHash: false, | |
| // Enable the algorithm to create a checksum of the file contents and use that in the comparison to determine | |
| // if the file should be run. Requires that scripts are coded to be run multiple times. | |
| useFileHash: true, |
migrate-mongo