added Comment model & schema

This commit is contained in:
srgooglo 2022-03-14 18:44:54 +01:00
parent 83e351f44b
commit 40548b3d88
3 changed files with 11 additions and 2 deletions

View File

@ -17,4 +17,6 @@ export const Config = mongoose.model("Config", schemas.Config, "config")
export const User = mongoose.model("User", schemas.User, "accounts")
export const Session = mongoose.model("Session", schemas.Session, "sessions")
export const Role = mongoose.model("Role", schemas.Role, "roles")
export const Post = mongoose.model("Post", schemas.Post, "posts")
export const Post = mongoose.model("Post", schemas.Post, "posts")
export const Comment = mongoose.model("Comment", schemas.Comment, "comments")
//export const Tag = mongoose.model("Tag", schemas.Tag, "tags")

View File

@ -0,0 +1,6 @@
export default {
user_id: { type: String, required: true },
content: { type: String, required: true },
created_at: { type: Date, default: Date.now },
liked: { type: Array, default: [] },
}

View File

@ -2,4 +2,5 @@ export { default as User } from "./user"
export { default as Role } from "./role"
export { default as Session } from "./session"
export { default as Config } from "./config"
export { default as Post } from "./post"
export { default as Post } from "./post"
export { default as Comment } from "./comment"