upd
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { model, Schema } from "mongoose";
|
||||
|
||||
const rolesSchema = new Schema(
|
||||
{
|
||||
userId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
toJSON: { virtuals: true },
|
||||
toObject: { virtuals: true },
|
||||
}
|
||||
);
|
||||
|
||||
const Roles = model("Roles", rolesSchema);
|
||||
|
||||
export default Roles;
|
||||
Reference in New Issue
Block a user