cloud-ide-model-schema
Version:
Pachage for schema management of Cloud IDEsys LMS
130 lines (129 loc) • 4.32 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CAppVersionMst = void 0;
var mongoose_1 = require("mongoose");
/* SCHEMA START */
var app_version_mst = new mongoose_1.Schema({
appver_reg_id_appreg: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "app_registration_mst",
required: true,
comment: "FK to app_registration_mst - Reference to app registration"
},
appver_version_number: {
type: String,
required: true,
maxlength: 50,
trim: true,
comment: "Internal version number (e.g., '1.0.0', '1.0.1') - unique per app"
},
appver_version_code: {
type: Number,
required: true,
comment: "Internal incremental version code (1, 2, 3...) - unique per app"
},
appver_release_type_id_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
required: true,
comment: "FK to core_general_master - Release type (APP_RELEASE_TYPE)"
},
appver_is_active: {
type: Boolean,
default: true,
comment: "Is active version"
},
appver_is_forced: {
type: Boolean,
default: false,
comment: "Force update required (mobile apps only)"
},
appver_min_supported_version: {
type: String,
maxlength: 50,
trim: true,
comment: "Minimum version required (mobile apps only)"
},
appver_release_date: {
type: Date,
required: true,
default: Date.now,
comment: "Release date"
},
appver_release_notes: {
type: String,
maxlength: 5000,
trim: true,
comment: "General release notes (store-specific notes in publish_details)"
},
appver_build_number: {
type: String,
maxlength: 50,
trim: true,
comment: "Build number"
},
appver_bundle_size: {
type: Number,
required: true,
comment: "Size in bytes"
},
appver_bundle_file_id_cyfm: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_file_manager",
required: true,
comment: "FK to core_file_manager - Update bundle file (mobile OTA) or build file (web)"
},
appver_bundle_hash: {
type: String,
required: true,
maxlength: 64,
trim: true,
comment: "SHA-256 hash for verification"
},
appver_bundle_signature: {
type: String,
maxlength: 1000,
trim: true,
comment: "Digital signature (stored as file or text)"
},
appver_deployment_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)"
},
appver_deployed_by_id_auth: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "auth_user_mst",
comment: "FK to auth_user_mst - User who deployed"
},
appver_deployed_at: {
type: Date,
comment: "Date when version was deployed"
},
appver_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"
},
appver_created_at: {
type: Date,
default: Date.now,
comment: "Creation timestamp"
},
appver_updated_at: {
type: Date,
default: Date.now,
comment: "Last update timestamp"
}
}, { collection: 'app_version_mst', timestamps: { createdAt: 'appver_created_at', updatedAt: 'appver_updated_at' } });
// Indexes for performance optimization
app_version_mst.index({ appver_reg_id_appreg: 1, appver_version_number: 1 }, { unique: true });
app_version_mst.index({ appver_reg_id_appreg: 1, appver_version_code: 1 }, { unique: true });
app_version_mst.index({ appver_reg_id_appreg: 1 });
app_version_mst.index({ appver_release_type_id_sygms: 1 });
app_version_mst.index({ appver_deployment_status_id_sygms: 1 });
app_version_mst.index({ appver_is_active: 1 });
var CAppVersionMst = mongoose_1.default.model("app_version_mst", app_version_mst);
exports.CAppVersionMst = CAppVersionMst;