model filling
This commit is contained in:
parent
c27c061c15
commit
6ca82f8c2e
29 changed files with 245 additions and 132 deletions
|
@ -1,14 +1,42 @@
|
|||
import { IsArray, IsString, IsOptional } from "class-validator";
|
||||
import { Schema, model } from "mongoose";
|
||||
import mongoose, { Schema, model } from "mongoose";
|
||||
import { PipelineModel, schemaPipeline } from "../pipelines/pipeline_model";
|
||||
|
||||
export interface IProjectModel {
|
||||
pipelines: [PipelineModel];
|
||||
rootDir: string;
|
||||
}
|
||||
|
||||
export interface IProjectModel {}
|
||||
|
||||
export const ProjectSchema = new Schema({
|
||||
|
||||
});
|
||||
pipelines: {
|
||||
type: Array<Schema.Types.ObjectId>,
|
||||
ref: schemaPipeline,
|
||||
autopopulate: true,
|
||||
default: null,
|
||||
},
|
||||
rootDir: {
|
||||
type: String,
|
||||
},
|
||||
}).plugin(require("mongoose-autopopulate"));
|
||||
|
||||
const schema = "Projects";
|
||||
|
||||
export const ProjectDBModel = model<IProjectModel>(schema, ProjectSchema);
|
||||
|
||||
export class ProjectModel implements IProjectModel {}
|
||||
export class ProjectModel implements IProjectModel {
|
||||
pipelines: [PipelineModel];
|
||||
rootDir: string;
|
||||
}
|
||||
|
||||
// export class ProcessModel implements IProcessMetaData {
|
||||
|
||||
// public process: IProcess;
|
||||
|
||||
// public trigger: ObjectId;
|
||||
|
||||
// // TODO(IDONTSUDO): later, when maintaining many environments, you will need to make a table
|
||||
// public env = null;
|
||||
|
||||
// @IsEnum(StackGenerateType)
|
||||
// public stackGenerateType: StackGenerateType;
|
||||
// }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue