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(),
|
||||
},
|
||||
});
|
||||
hasMigrated && !mongoose.models.Story;
|
||||
Chapter.plugin(AutoIncrement, { id: "chapterid", inc_field: "id" });
|
||||
hasMigrated &&
|
||||
!mongoose.models.Story &&
|
||||
Chapter.plugin(AutoIncrement, { id: "chapterid", inc_field: "id" });
|
||||
hasMigrated &&
|
||||
!mongoose.models.Story &&
|
||||
StorySchema.plugin(AutoIncrement, { id: "storyid" });
|
||||
|
Loading…
Reference in New Issue
Block a user