mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Removed duplicate migration
no issue - The migration didn't want to go away after rebases combined with renames
This commit is contained in:
parent
7785fb6dc5
commit
e0cc314f91
@ -1,33 +0,0 @@
|
||||
const logging = require('../../../../../shared/logging');
|
||||
const {createIrreversibleMigration} = require('../../utils');
|
||||
|
||||
module.exports = createIrreversibleMigration(async (knex) => {
|
||||
const unsplashSetting = await knex('settings')
|
||||
.select('value')
|
||||
.where({
|
||||
key: 'unsplash'
|
||||
})
|
||||
.first();
|
||||
|
||||
let isActive;
|
||||
try {
|
||||
const value = JSON.parse(unsplashSetting.value);
|
||||
isActive = typeof value.isActive === 'boolean' ? value.isActive : true;
|
||||
} catch (err) {
|
||||
logging.warn(`Wasn't able to parse 'unsplash' setting: ${unsplashSetting.value}, falling back to: 'true'`);
|
||||
isActive = true;
|
||||
}
|
||||
|
||||
logging.info(`Updating 'unsplash' setting to: ${isActive}`);
|
||||
|
||||
await knex('settings')
|
||||
.update({
|
||||
group: 'unsplash',
|
||||
type: 'boolean',
|
||||
flags: null,
|
||||
value: isActive.toString()
|
||||
})
|
||||
.where({
|
||||
key: 'unsplash'
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user