2023-10-31 09:03:41 +03:00
|
|
|
import { Schema, model } from "mongoose";
|
2024-04-09 16:31:25 +03:00
|
|
|
import { PipelineValidationModel } from "../../_pipelines/models/pipeline_validation_model";
|
2023-10-27 21:22:48 +03:00
|
|
|
|
|
|
|
export interface IProjectModel {
|
2023-11-20 00:48:40 +03:00
|
|
|
_id?: string;
|
|
|
|
pipelines: [PipelineValidationModel];
|
2023-10-27 21:22:48 +03:00
|
|
|
rootDir: string;
|
2023-11-10 12:06:40 +03:00
|
|
|
description: string;
|
2023-11-28 18:34:41 +03:00
|
|
|
isActive: boolean;
|
2023-10-27 21:22:48 +03:00
|
|
|
}
|
2023-10-26 17:44:54 +03:00
|
|
|
|
|
|
|
export const ProjectSchema = new Schema({
|
2023-11-10 12:06:40 +03:00
|
|
|
description: {
|
|
|
|
type: String,
|
|
|
|
},
|
2024-04-09 16:31:25 +03:00
|
|
|
rootDir: {
|
|
|
|
type: String,
|
|
|
|
},
|
2023-11-20 00:48:40 +03:00
|
|
|
isActive: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2023-10-27 21:22:48 +03:00
|
|
|
}).plugin(require("mongoose-autopopulate"));
|
2023-10-26 17:44:54 +03:00
|
|
|
|
2023-11-20 00:48:40 +03:00
|
|
|
export const projectSchema = "Projects";
|
2023-10-26 17:44:54 +03:00
|
|
|
|
2023-11-20 00:48:40 +03:00
|
|
|
export const ProjectDBModel = model<IProjectModel>(projectSchema, ProjectSchema);
|