mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Revert "Added migration to remove deprecated values from the settings table (#11942)"
This reverts commit bdd8049e06
.
- Revert was done to allow emergency releaese
This commit is contained in:
parent
1eeb5a60b8
commit
32cb9c7f94
1 changed files with 0 additions and 65 deletions
|
@ -1,65 +0,0 @@
|
|||
const ObjectId = require('bson-objectid');
|
||||
const logging = require('../../../../../shared/logging');
|
||||
|
||||
module.exports = {
|
||||
config: {
|
||||
transaction: true
|
||||
},
|
||||
|
||||
async up(options) {
|
||||
const settingsKeys = ['force_i18n', 'permalinks', 'members_session_secret'];
|
||||
|
||||
logging.info(`Removing ${settingsKeys.join(',')} from "settings" table.`);
|
||||
|
||||
return await options
|
||||
.transacting('settings')
|
||||
.whereIn('key', settingsKeys)
|
||||
.del();
|
||||
},
|
||||
|
||||
async down(options) {
|
||||
const currentTimestamp = options.transacting.raw('CURRENT_TIMESTAMP');
|
||||
|
||||
const forceI18nSetting = {
|
||||
id: ObjectId.generate(),
|
||||
key: 'force_i18n',
|
||||
value: 'true',
|
||||
type: 'blog',
|
||||
created_at: currentTimestamp,
|
||||
created_by: 1,
|
||||
updated_at: currentTimestamp,
|
||||
updated_by: 1
|
||||
};
|
||||
|
||||
const permalinksSetting = {
|
||||
id: ObjectId.generate(),
|
||||
key: 'permalinks',
|
||||
value: '/:slug/',
|
||||
type: 'blog',
|
||||
created_at: currentTimestamp,
|
||||
created_by: 1,
|
||||
updated_at: currentTimestamp,
|
||||
updated_by: 1
|
||||
};
|
||||
|
||||
const membersSessionSecretSetting = {
|
||||
id: ObjectId.generate(),
|
||||
key: 'members_session_secret',
|
||||
value: null,
|
||||
type: 'members',
|
||||
created_at: currentTimestamp,
|
||||
created_by: 1,
|
||||
updated_at: currentTimestamp,
|
||||
updated_by: 1
|
||||
};
|
||||
|
||||
logging.info('Adding force_i18n, permalinks, and members_session_secret to "settings" table.');
|
||||
|
||||
return options.transacting('settings')
|
||||
.insert([
|
||||
forceI18nSetting,
|
||||
permalinksSetting,
|
||||
membersSessionSecretSetting
|
||||
]);
|
||||
}
|
||||
};
|
Loading…
Add table
Reference in a new issue