fix(db/models): short-circuit story model definition + plugin load
This commit is contained in:
parent
3d3580be07
commit
722368c707
@ -87,8 +87,9 @@ const StorySchema = new mongoose.Schema<IStory>({
|
|||||||
default: new Date(),
|
default: new Date(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
hasMigrated && !mongoose.models.Story;
|
hasMigrated &&
|
||||||
Chapter.plugin(AutoIncrement, { id: "chapterid", inc_field: "id" });
|
!mongoose.models.Story &&
|
||||||
|
Chapter.plugin(AutoIncrement, { id: "chapterid", inc_field: "id" });
|
||||||
hasMigrated &&
|
hasMigrated &&
|
||||||
!mongoose.models.Story &&
|
!mongoose.models.Story &&
|
||||||
StorySchema.plugin(AutoIncrement, { id: "storyid" });
|
StorySchema.plugin(AutoIncrement, { id: "storyid" });
|
||||||
|
Loading…
Reference in New Issue
Block a user