Skip to content

Commit

Permalink
chore: earn migration part 2 (#3740)
Browse files Browse the repository at this point in the history
* chore: earn migration part 2

* chore: renaming createAt to createdAt

---------

Co-authored-by: Nicolas Burtey <[email protected]>
  • Loading branch information
nicolasburtey and Nicolas Burtey authored Dec 21, 2023
1 parent 035ec24 commit e7393fc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/api/src/migrations/20231220190840-quiz-new-collection-2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
/* eslint @typescript-eslint/ban-ts-comment: "off" */
// @ts-ignore-next-line no-implicit-any error
async up(db) {
console.log("Begin earn removal")
const res = await db
.collection("accounts")
.updateMany({}, { $unset: { earn: 1 } }, { multi: true })
console.log({ res }, `end earn removal`)

console.log("renaming createdAt")
const res2 = await db
.collection("quizzes")
.updateMany({}, { $rename: { createAt: "createdAt" } })
console.log({ res2 }, `end renaming createdAt"`)
},
}

0 comments on commit e7393fc

Please sign in to comment.