From d38c217a583e0efe3b4017df2d27c76d61bca8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 16 Mar 2024 20:53:50 -0400 Subject: [PATCH] fix(db/models): remove check for story model's existence the check will always evaluate to `false`, preventing the chapter id counter from being added --- models/stories/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stories/index.ts b/models/stories/index.ts index 6d4acd1..4c84b9d 100644 --- a/models/stories/index.ts +++ b/models/stories/index.ts @@ -87,6 +87,6 @@ const StorySchema = new mongoose.Schema({ default: new Date(), }, }); -hasMigrated && !mongoose.models.Story && Chapter.plugin(AutoIncrement, { id: "chapterid", inc_field: "id" }); +hasMigrated && Chapter.plugin(AutoIncrement, { id: "chapterid", inc_field: "id" }); hasMigrated && StorySchema.plugin(AutoIncrement, { id: "storyid" }); export const Story: Model = /* mongoose.models.Story || */ mongoose.model("Story", StorySchema, "stories");