|
@@ -1,6 +1,6 @@
|
|
|
import mongoose from 'mongoose';
|
|
import mongoose from 'mongoose';
|
|
|
|
|
|
|
|
-import config from '^/config/migrate';
|
|
|
|
|
|
|
+import { getMongoUri, mongoOptions } from '@growi/core';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
|
|
const logger = loggerFactory('growi:migrate:add-column-is-trashed');
|
|
const logger = loggerFactory('growi:migrate:add-column-is-trashed');
|
|
@@ -21,7 +21,7 @@ const updateIsPageTrashed = async(db, updateIdList) => {
|
|
|
module.exports = {
|
|
module.exports = {
|
|
|
async up(db) {
|
|
async up(db) {
|
|
|
logger.info('Apply migration');
|
|
logger.info('Apply migration');
|
|
|
- mongoose.connect(config.mongoUri, config.mongodb.options);
|
|
|
|
|
|
|
+ mongoose.connect(getMongoUri(), mongoOptions);
|
|
|
|
|
|
|
|
let updateDeletedPageIds = [];
|
|
let updateDeletedPageIds = [];
|
|
|
|
|
|
|
@@ -51,7 +51,7 @@ module.exports = {
|
|
|
|
|
|
|
|
async down(db) {
|
|
async down(db) {
|
|
|
logger.info('Rollback migration');
|
|
logger.info('Rollback migration');
|
|
|
- mongoose.connect(config.mongoUri, config.mongodb.options);
|
|
|
|
|
|
|
+ mongoose.connect(getMongoUri(), mongoOptions);
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
await db.collection('pagetagrelations').updateMany(
|
|
await db.collection('pagetagrelations').updateMany(
|