upd
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { Schema, model } from "mongoose";
|
||||
|
||||
const projectSchema = new Schema(
|
||||
{
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
company: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
city: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
image: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
stage: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
releaseYear: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
devices: {
|
||||
type: Array,
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
toJSON: { virtuals: true },
|
||||
toObject: { virtuals: true },
|
||||
}
|
||||
);
|
||||
|
||||
const Project = model("Project", projectSchema);
|
||||
|
||||
export default Project;
|
||||
Reference in New Issue
Block a user