upd
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
import { model, Schema } from "mongoose";
|
||||
|
||||
const buildUserSchema = new Schema(
|
||||
{
|
||||
buildId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: "Build",
|
||||
required: true,
|
||||
},
|
||||
userId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: "User",
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
toJSON: { virtuals: true },
|
||||
toObject: { virtuals: true },
|
||||
}
|
||||
);
|
||||
|
||||
const BuildUser = model("Build_User", buildUserSchema);
|
||||
|
||||
export default BuildUser;
|
||||
@@ -11,22 +11,26 @@ const userSchema = new Schema(
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
companyId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: "Company",
|
||||
role: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
role: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
avatar: {
|
||||
type: String,
|
||||
},
|
||||
companyId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: "Company",
|
||||
required: true,
|
||||
},
|
||||
buildIds: {
|
||||
type: [Schema.Types.ObjectId],
|
||||
ref: "Build",
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
||||
Reference in New Issue
Block a user