소스 검색

add comment

Shun Miyazawa 1 년 전
부모
커밋
ae1251fbf1
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      apps/app/src/migrations/20211227060705-revision-path-to-page-id-schema-migration--fixed-7549.js

+ 4 - 0
apps/app/src/migrations/20211227060705-revision-path-to-page-id-schema-migration--fixed-7549.js

@@ -18,6 +18,8 @@ module.exports = {
   async up(db, client) {
     mongoose.connect(getMongoUri(), mongoOptions);
     const Page = getModelSafely('Page') || getPageModel();
+
+    // Do not use models in /server/models/revision because of schema changes
     const Revision = await db.collection('revisions');
 
     const pagesStream = await Page.find({ revision: { $ne: null } }, { _id: 1, path: 1 }).cursor({ batch_size: LIMIT });
@@ -69,6 +71,8 @@ module.exports = {
   async down(db, client) {
     mongoose.connect(getMongoUri(), mongoOptions);
     const Page = getModelSafely('Page') || getPageModel();
+
+    // Do not use models in /server/models/revision because of schema changes
     const Revision = await db.collection('revisions');
 
     const pagesStream = await Page.find({ revision: { $ne: null } }, { _id: 1, path: 1 }).cursor({ batch_size: LIMIT });