UNPKG

cloud-ide-model-schema

Version:

Pachage for schema management of Cloud IDEsys LMS

69 lines (68 loc) 1.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CBackupPolicy = void 0; var mongoose_1 = require("mongoose"); var backup_policies = new mongoose_1.Schema({ bpol_name: { type: String, required: true, maxlength: 100, trim: true, unique: true }, bpol_retention_days: { type: Number, required: true, default: 30, min: 1 }, bpol_backup_frequency: { type: String, required: true, enum: ['hourly', 'daily', 'weekly', 'monthly'] }, bpol_encryption_enabled: { type: Boolean, default: false }, bpol_compression_enabled: { type: Boolean, default: true }, bpol_auto_cleanup: { type: Boolean, default: true }, bpol_notification_enabled: { type: Boolean, default: true }, bpol_notification_emails: { type: [String] }, bpol_description: { type: String, maxlength: 500 }, bpol_created_by: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst" }, bpol_created_at: { type: Date, default: Date.now }, bpol_updated_at: { type: Date, default: Date.now }, bpol_isactive: { type: Boolean, default: true } }, { collection: 'backup_policies', timestamps: { createdAt: 'bpol_created_at', updatedAt: 'bpol_updated_at' } }); // Indexes // Note: bpol_name index is automatically created by unique: true backup_policies.index({ bpol_isactive: 1 }); var CBackupPolicy = mongoose_1.default.model("backup_policies", backup_policies); exports.CBackupPolicy = CBackupPolicy;