27 lines
637 B
TypeScript
27 lines
637 B
TypeScript
import { Schema, model } from "mongoose";
|
|
import { PipelineValidationModel } from "../../_pipelines/models/pipeline_validation_model";
|
|
|
|
export interface IProjectModel {
|
|
_id?: string;
|
|
pipelines: [PipelineValidationModel];
|
|
rootDir: string;
|
|
description: string;
|
|
isActive: boolean;
|
|
}
|
|
|
|
export const ProjectSchema = new Schema({
|
|
description: {
|
|
type: String,
|
|
},
|
|
rootDir: {
|
|
type: String,
|
|
},
|
|
isActive: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
}).plugin(require("mongoose-autopopulate"));
|
|
|
|
export const projectSchema = "Projects";
|
|
|
|
export const ProjectDBModel = model<IProjectModel>(projectSchema, ProjectSchema);
|