22 lines
395 B
JavaScript
22 lines
395 B
JavaScript
import mongoose from "mongoose";
|
|
|
|
const categorySchema = new mongoose.Schema(
|
|
{
|
|
name: {
|
|
type: String,
|
|
required: true,
|
|
unique: true,
|
|
trim: true,
|
|
},
|
|
projectId: {
|
|
type: String, // For multi-project support
|
|
required: true,
|
|
},
|
|
},
|
|
{ timestamps: true }
|
|
);
|
|
|
|
const Category = mongoose.model("Category", categorySchema);
|
|
|
|
export default Category;
|