Browse Source

add new field to page operation schema and type

yohei0125 3 years ago
parent
commit
6b81118344
1 changed files with 3 additions and 0 deletions
  1. 3 0
      packages/app/src/server/models/page-operation.ts

+ 3 - 0
packages/app/src/server/models/page-operation.ts

@@ -1,4 +1,5 @@
 import { getOrCreateModel } from '@growi/core';
 import { getOrCreateModel } from '@growi/core';
+import { addSeconds } from 'date-fns';
 import mongoose, {
 import mongoose, {
   Schema, Model, Document, QueryOptions, FilterQuery,
   Schema, Model, Document, QueryOptions, FilterQuery,
 } from 'mongoose';
 } from 'mongoose';
@@ -43,6 +44,7 @@ export interface IPageOperation {
   user: IUserForResuming,
   user: IUserForResuming,
   options?: IOptionsForResuming,
   options?: IOptionsForResuming,
   incForUpdatingDescendantCount?: number,
   incForUpdatingDescendantCount?: number,
+  unprocessableExpiryDate: Date,
 }
 }
 
 
 export interface PageOperationDocument extends IPageOperation, Document {}
 export interface PageOperationDocument extends IPageOperation, Document {}
@@ -99,6 +101,7 @@ const schema = new Schema<PageOperationDocument, PageOperationModel>({
   user: { type: userSchemaForResuming, required: true },
   user: { type: userSchemaForResuming, required: true },
   options: { type: optionsSchemaForResuming },
   options: { type: optionsSchemaForResuming },
   incForUpdatingDescendantCount: { type: Number },
   incForUpdatingDescendantCount: { type: Number },
+  unprocessableExpiryDate: { type: Date, default: addSeconds(new Date(), 10) },
 });
 });
 
 
 schema.statics.findByIdAndUpdatePageActionStage = async function(
 schema.statics.findByIdAndUpdatePageActionStage = async function(