-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into snyk-upgrade-7914aea754b5fa005ce14875a295e555
- Loading branch information
Showing
12 changed files
with
21,650 additions
and
2,079 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import register from "./src/index.js"; | ||
|
||
export { default as migrations } from "./migrations/index.js"; | ||
|
||
export default register; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* @summary adds createdAt and updatedAt fields to the current collection and assigns it to 01-01-1970 | ||
* @param {Object} args - the arguments | ||
* @param {Object} args.db - the DB client | ||
* @param {Function} args.progress - a function to set the progress of the operation | ||
* @returns {undefined} | ||
*/ | ||
async function up({ db, progress }) { | ||
progress(0); | ||
|
||
const date = new Date(1970, 0, 1); | ||
const query = { createdAt: { $exists: false }, updatedAt: { $exists: false } }; | ||
const update = { $set: { createdAt: date, updatedAt: date } }; | ||
const options = { upsert: false, multi: true }; | ||
|
||
await db.collection("Emails").update(query, update, options); | ||
|
||
progress(100); | ||
} | ||
|
||
export default { | ||
down: "unnecessary", | ||
up | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { migrationsNamespace } from "./migrationsNamespace.js"; | ||
import migration2 from "./2.js"; | ||
|
||
export default { | ||
tracks: [ | ||
{ | ||
namespace: migrationsNamespace, | ||
migrations: { | ||
2: migration2 | ||
} | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const migrationsNamespace = "email"; |
Oops, something went wrong.