27 lines
687 B
TypeScript
27 lines
687 B
TypeScript
import { Schema, model } from "mongoose";
|
|
import { IProjectModel, projectSchema } from "../../_projects/models/project_database_model";
|
|
|
|
export interface IProjectInstanceModel {
|
|
_id: string;
|
|
project: IProjectModel;
|
|
description: string;
|
|
rootDir: string;
|
|
isActive: boolean;
|
|
}
|
|
|
|
export const ProjectInstanceSchema = new Schema({
|
|
description: {
|
|
type: String,
|
|
},
|
|
rootDir: {
|
|
type: String,
|
|
},
|
|
isActive: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
}).plugin(require("mongoose-autopopulate"));
|
|
|
|
export const schemaProjectInstance = "instance_project";
|
|
|
|
export const ProjectInstanceDbModel = model<IProjectInstanceModel>(schemaProjectInstance, ProjectInstanceSchema);
|