mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
Upgrade Mongoose and the Mongo driver in web GitOrigin-RevId: 2cad1aabe57eae424a9e4c68b2e0062f0e78ffaf
35 lines
774 B
JavaScript
35 lines
774 B
JavaScript
const mongoose = require('../infrastructure/Mongoose')
|
|
const { SubscriptionSchema } = require('./Subscription')
|
|
|
|
const { Schema } = mongoose
|
|
const { ObjectId } = Schema
|
|
|
|
const DeleterDataSchema = new Schema(
|
|
{
|
|
deleterId: { type: ObjectId, ref: 'User' },
|
|
deleterIpAddress: { type: String },
|
|
deletedAt: {
|
|
type: Date,
|
|
default() {
|
|
return new Date()
|
|
},
|
|
},
|
|
},
|
|
{ _id: false }
|
|
)
|
|
|
|
const DeletedSubscriptionSchema = new Schema(
|
|
{
|
|
deleterData: DeleterDataSchema,
|
|
subscription: SubscriptionSchema,
|
|
},
|
|
{ collection: 'deletedSubscriptions', minimize: false }
|
|
)
|
|
|
|
exports.DeletedSubscription = mongoose.model(
|
|
'DeletedSubscription',
|
|
DeletedSubscriptionSchema
|
|
)
|
|
|
|
exports.DeletedSubscriptionSchema = DeletedSubscriptionSchema
|