-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into #159-add-typescript-support
Compile errors will be fixed later
- Loading branch information
Showing
62 changed files
with
2,005 additions
and
939 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,34 @@ | ||
// Issue #449-1을 해결하기 위한 DB 마이그레이션 스크립트입니다. | ||
// chat type 중 settlement와 payment를 서로 교체합니다. | ||
// https://github.com/sparcs-kaist/taxi-back/issues/449 | ||
|
||
const { MongoClient } = require("mongodb"); | ||
const { mongo: mongoUrl } = require("../loadenv"); | ||
|
||
const client = new MongoClient(mongoUrl); | ||
const db = client.db("taxi"); | ||
const chats = db.collection("chats"); | ||
|
||
async function run() { | ||
try { | ||
for await (const doc of chats.find()) { | ||
if (doc.type === "settlement" || doc.type === "payment") { | ||
await chats.findOneAndUpdate( | ||
{ _id: doc._id }, | ||
{ | ||
$set: { | ||
type: doc.type === "settlement" ? "payment" : "settlement", | ||
}, | ||
} | ||
); | ||
} | ||
} | ||
} catch (err) { | ||
console.log(err); | ||
} finally { | ||
await client.close(); | ||
} | ||
} | ||
run().then(() => { | ||
console.log("Done!"); | ||
}); |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Oops, something went wrong.