diff --git a/models/band.ts b/models/band.ts index a58fef9..5cd73bd 100644 --- a/models/band.ts +++ b/models/band.ts @@ -1,4 +1,4 @@ -import mongoose, { connect, PopulatedDoc, Document, Model } from "mongoose"; +import mongoose, { connect, Document, Model } from "mongoose"; const { Schema, model } = mongoose; import SequenceFactory from "mongoose-sequence"; import { hasMigrated } from "~/lib/dbconfig"; diff --git a/models/challenges/biffno.ts b/models/challenges/biffno.ts index 587e4fe..28fb3bf 100644 --- a/models/challenges/biffno.ts +++ b/models/challenges/biffno.ts @@ -67,7 +67,8 @@ const biffnoschema = new mongoose.Schema({ }, }); -hasMigrated && !mongoose.models.Biffno; -biffnoschema.plugin(AutoIncrement, { start_seq: 1, id: "bif_id" }); +hasMigrated && + !mongoose.models.Biffno && + biffnoschema.plugin(AutoIncrement, { start_seq: 1, id: "bif_id" }); export const Biffno: Model = mongoose.models.Biffno || mongoose.model("Biffno", biffnoschema, "biffno"); diff --git a/models/challenges/gen.ts b/models/challenges/gen.ts index d6f140d..a820dbd 100644 --- a/models/challenges/gen.ts +++ b/models/challenges/gen.ts @@ -49,5 +49,5 @@ hasMigrated && !mongoose.models.Challenge && challengeSchema.plugin(AutoIncrement, { id: "challenges" }); export const Challenge: Model = - mongoose.models.Challenge || + // mongoose.models.Challenge || mongoose.model("Challenge", challengeSchema, "challenges"); diff --git a/models/stories/index.ts b/models/stories/index.ts index 1d9a106..8ea08b6 100644 --- a/models/stories/index.ts +++ b/models/stories/index.ts @@ -90,9 +90,7 @@ const StorySchema = new mongoose.Schema({ hasMigrated && !mongoose.models.Story && Chapter.plugin(AutoIncrement, { id: "chapterid", inc_field: "id" }); -hasMigrated && - !mongoose.models.Story && - StorySchema.plugin(AutoIncrement, { id: "storyid" }); +hasMigrated && StorySchema.plugin(AutoIncrement, { id: "storyid" }); export const Story: Model = /* mongoose.models.Story || */ mongoose.model( "Story",