feat; change model names (Material -> WidgetFamily)
This commit is contained in:
27
src/models/WidgetFamily.js
Normal file
27
src/models/WidgetFamily.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const schema = new mongoose.Schema(
|
||||
{
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
trim: true,
|
||||
},
|
||||
parent: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: "WidgetFamily",
|
||||
},
|
||||
inventory: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: "Inventory",
|
||||
required: true
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
}
|
||||
);
|
||||
|
||||
const WidgetFamily = mongoose.model("WidgetFamily", schema);
|
||||
|
||||
module.exports = WidgetFamily;
|
||||
Reference in New Issue
Block a user