WNomunomu 1 год назад
Родитель
Сommit
80be71947b
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      apps/app/src/server/routes/apiv3/revisions.js

+ 3 - 2
apps/app/src/server/routes/apiv3/revisions.js

@@ -15,6 +15,8 @@ const { query, param } = require('express-validator');
 
 
 const router = express.Router();
 const router = express.Router();
 
 
+const MIGRATION_FILE_NAME = '20211227060705-revision-path-to-page-id-schema-migration--fixed-7549.js';
+
 /**
 /**
  * @swagger
  * @swagger
  *  tags:
  *  tags:
@@ -133,9 +135,8 @@ module.exports = (crowi) => {
     try {
     try {
       const page = await Page.findOne({ _id: pageId });
       const page = await Page.findOne({ _id: pageId });
 
 
-      const fileName = '20211227060705-revision-path-to-page-id-schema-migration--fixed-7549.js';
       const migrationCollection = connection.collection('migrations');
       const migrationCollection = connection.collection('migrations');
-      const migration = await migrationCollection.findOne({ fileName });
+      const migration = await migrationCollection.findOne({ MIGRATION_FILE_NAME });
       const appliedAt = migration.appliedAt;
       const appliedAt = migration.appliedAt;
 
 
       const queryOpts = {
       const queryOpts = {