Просмотр исходного кода

Merge pull request #2760 from weseek/master

release v.4.1.5
Yuki Takei 5 лет назад
Родитель
Сommit
2bc8ac9e26
3 измененных файлов с 43 добавлено и 3 удалено
  1. 8 2
      CHANGES.md
  2. 1 1
      package.json
  3. 34 0
      src/migrations/20200901034314-update-mail-transmission-fix.js

+ 8 - 2
CHANGES.md

@@ -1,11 +1,17 @@
 # CHANGES
 # CHANGES
 
 
-## v4.1.4-RC
+## v4.1.6-RC
+
+* 
+
+## v4.1.5
 
 
 * Feature: Independent S3 configuration and SES configuration for AWS
 * Feature: Independent S3 configuration and SES configuration for AWS
 * Fix: Author name does not displayed in page history
 * Fix: Author name does not displayed in page history
 * Fix: Hide unnecessary component when pringing
 * Fix: Hide unnecessary component when pringing
 
 
+## v4.1.4 (Missing number)
+
 ## v4.1.3
 ## v4.1.3
 
 
 * Feature: Create/edit linker with GUI
 * Feature: Create/edit linker with GUI
@@ -99,7 +105,7 @@ Upgrading Guide: <https://docs.growi.org/en/admin-guide/upgrading/41x.html>
 * Fix: Unable to create page with original path after emptying trash
 * Fix: Unable to create page with original path after emptying trash
 * I18n: Support zh-CN
 * I18n: Support zh-CN
 
 
-## v4.0.8  (Missing number)
+## v4.0.8 (Missing number)
 
 
 ## v4.0.7
 ## v4.0.7
 
 

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "growi",
   "name": "growi",
-  "version": "4.1.4-RC",
+  "version": "4.1.5-RC",
   "description": "Team collaboration software using markdown",
   "description": "Team collaboration software using markdown",
   "tags": [
   "tags": [
     "wiki",
     "wiki",

+ 34 - 0
src/migrations/20200901034314-update-mail-transmission-fix.js

@@ -0,0 +1,34 @@
+require('module-alias/register');
+const logger = require('@alias/logger')('growi:migrate:update-mail-transmission-fix');
+
+const mongoose = require('mongoose');
+const config = require('@root/config/migrate');
+
+const { getModelSafely } = require('@commons/util/mongoose-utils');
+
+module.exports = {
+  async up(db, client) {
+    logger.info('Apply migration');
+    mongoose.connect(config.mongoUri, config.mongodb.options);
+
+    const Config = getModelSafely('Config') || require('@server/models/config')();
+
+    const transmissionMethod = await Config.findOne({
+      ns: 'crowi',
+      key: 'mail:transmissionMethod',
+    });
+
+    if (transmissionMethod == null) {
+      return logger.info('No need to change.');
+    }
+
+    transmissionMethod.value = JSON.stringify(transmissionMethod.value);
+    await transmissionMethod.save();
+
+    logger.info('Migration has successfully applied');
+  },
+
+  async down(db, client) {
+    // do not rollback
+  },
+};