Skip to content

Commit

Permalink
Move migration to db-migrations/ (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
zichongkao committed Jun 5, 2023
1 parent fb7bf62 commit eb9f39f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 90 deletions.
24 changes: 24 additions & 0 deletions db-migrations/0003-date-climbed-to-date.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* https://github.com/OpenBeta/openbeta-graphql/pull/301
**/

const rs = db.ticks.updateMany(
{
dateClimbed: { $exists: true }
},
[{
$set: {
dateClimbed: {
$dateFromString: {
dateString: '$dateClimbed',
// We want to ascribe an hour of day to the climb, so it shows
// up on the correct day when displayed in the user's timezone.
// Most climbs are in the US, MT time is a good first approximation.
timezone: 'America/Denver'
}
}
}
}]
)

printjson(rs)
35 changes: 0 additions & 35 deletions src/db/utils/jobs/migration/ConvertTickDateClimbedToDate.ts

This file was deleted.

This file was deleted.

0 comments on commit eb9f39f

Please sign in to comment.