cloud-ide-model-schema
Version:
Pachage for schema management of Cloud IDEsys LMS
91 lines (90 loc) • 3.29 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CAppUpdateDeploymentMst = void 0;
var mongoose_1 = require("mongoose");
/* SCHEMA START */
var app_update_deployment_mst = new mongoose_1.Schema({
appdep_version_id_appver: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "app_version_mst",
required: true,
comment: "FK to app_version_mst - Reference to app version"
},
appdep_deployment_type_id_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
required: true,
comment: "FK to core_general_master - Deployment type (APP_DEPLOYMENT_TYPE)"
},
appdep_rollout_percentage: {
type: Number,
required: true,
min: 0,
max: 100,
comment: "0-100 for staged rollouts"
},
appdep_target_users: {
type: [String],
comment: "Specific user IDs (optional)"
},
appdep_start_date: {
type: Date,
required: true,
default: Date.now,
comment: "Deployment start date"
},
appdep_end_date: {
type: Date,
comment: "Deployment end date"
},
appdep_status_id_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
required: true,
comment: "FK to core_general_master - Deployment status (APP_DEPLOYMENT_STATUS)"
},
appdep_rollback_version_id_appver: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "app_version_mst",
comment: "FK to app_version_mst - If rolled back"
},
appdep_rollback_reason: {
type: String,
maxlength: 1000,
trim: true,
comment: "Rollback reason"
},
appdep_workflow_id_wfrg: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_workflow_registry",
comment: "FK to core_workflow_registry - Workflow for deployment approval (optional, recommended for production)"
},
appdep_current_step: {
type: Number,
comment: "Current workflow step (if workflow is active)"
},
appdep_created_by_id_auth: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "auth_user_mst",
required: true,
comment: "FK to auth_user_mst - User who created"
},
appdep_created_at: {
type: Date,
default: Date.now,
comment: "Creation timestamp"
},
appdep_updated_at: {
type: Date,
default: Date.now,
comment: "Last update timestamp"
}
}, { collection: 'app_update_deployment_mst', timestamps: { createdAt: 'appdep_created_at', updatedAt: 'appdep_updated_at' } });
// Indexes for performance optimization
app_update_deployment_mst.index({ appdep_version_id_appver: 1 });
app_update_deployment_mst.index({ appdep_deployment_type_id_sygms: 1 });
app_update_deployment_mst.index({ appdep_status_id_sygms: 1 });
app_update_deployment_mst.index({ appdep_workflow_id_wfrg: 1, appdep_current_step: 1 });
app_update_deployment_mst.index({ appdep_start_date: -1 });
var CAppUpdateDeploymentMst = mongoose_1.default.model("app_update_deployment_mst", app_update_deployment_mst);
exports.CAppUpdateDeploymentMst = CAppUpdateDeploymentMst;