Skip to content

feat: add migrate-mongo#864

Open
Anushtha-Rathore wants to merge 1 commit intoWalkover-Web-Solution:testingfrom
Anushtha-Rathore:migrate-mongo
Open

feat: add migrate-mongo#864
Anushtha-Rathore wants to merge 1 commit intoWalkover-Web-Solution:testingfrom
Anushtha-Rathore:migrate-mongo

Conversation

@Anushtha-Rathore
Copy link
Copy Markdown
Contributor

migrate-mongo

Copy link
Copy Markdown
Contributor

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +12 to +15
options: {
useNewUrlParser: true, // removes a deprecation warning when connecting
useUnifiedTopology: true // removes a deprecating warning when connecting
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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
}

Comment on lines +27 to +29
// 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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// 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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant