mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 19:14:16 +00:00
20 lines
631 B
JavaScript
20 lines
631 B
JavaScript
import mongoose, { Schema } from "mongoose"
|
|
|
|
function getSchemas() {
|
|
const obj = Object()
|
|
|
|
const _schemas = require("../schemas")
|
|
Object.keys(_schemas).forEach((key) => {
|
|
obj[key] = Schema(_schemas[key])
|
|
})
|
|
|
|
return obj
|
|
}
|
|
|
|
const schemas = getSchemas()
|
|
|
|
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") |