Skip to content

Commit 14fe84c

Browse files
committed
fix: remove patch
Signed-off-by: Innei <tukon479@gmail.com>
1 parent 00b66be commit 14fe84c

File tree

3 files changed

+1
-32
lines changed

3 files changed

+1
-32
lines changed

apps/core/src/migration/version/v8.4.0.fix1.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ export default (async function v0840Fix1(db: Db) {
66
try {
77
const notesCollection = db.collection('notes')
88

9-
// 移除 isPublished 字段
10-
await notesCollection.updateMany(
11-
{},
12-
{ $unset: { isPublished: '' } },
13-
{ upsert: false },
14-
)
15-
169
// 将 hide 字段重命名为 isPublished, 同时将true与false互换
1710
await notesCollection.updateMany(
1811
{},

apps/core/src/migration/version/v8.4.0.fix2.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default (async function v0840Fix2(db: Db) {
66
try {
77
const postsCollection = db.collection('posts')
88

9-
// 将 isPublished 字段全部设置为 true
109
await postsCollection.updateMany(
1110
{},
1211
{ $set: { isPublished: true } },
Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
11
// patch for version lower than v8.4.0
2-
// 本次migration会向posts和notes表中添加一个isPublished字段,默认值为true
3-
import type { Db } from 'mongodb'
42

5-
export default (async function v0840(db: Db) {
6-
try {
7-
const postsCollection = db.collection('posts')
8-
const notesCollection = db.collection('notes')
9-
10-
// 添加 isPublished 字段到 posts 集合
11-
await postsCollection.updateMany(
12-
{},
13-
{ $set: { isPublished: true } },
14-
{ upsert: false },
15-
)
16-
17-
// 添加 isPublished 字段到 notes 集合
18-
await notesCollection.updateMany(
19-
{},
20-
{ $set: { isPublished: true } },
21-
{ upsert: false },
22-
)
23-
} catch (error) {
24-
console.error('Migration to v8.4.0 failed:', error)
25-
}
26-
})
3+
export default (async function v0840() {})

0 commit comments

Comments
 (0)