Files
linux-odyssey/server/migrations/0001-add-isGuest.ts
Justin Lin 2feedc329c refactor: use bun for package management
+ add package.json to each packages
+ update import path
2026-10-11 16:50:01 +11:00

24 lines
442 B
TypeScript

import { connectDB, User } from '@odyssey/models'
async function migrate() {
await connectDB(
process.env.MONGO_URL || 'mongodb://localhost:27017/odyssey-test'
)
await User.updateMany(
{
isGuest: { $exists: false },
},
{ $set: { isGuest: false } }
)
}
migrate()
.then(() => {
console.log('Migration completed')
process.exit(0)
})
.catch((err) => {
console.error(err)
process.exit(1)
})