mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 19:02:29 +03:00
Fixed typo in migration to add backupContent permission (#12777)
refs https://github.com/TryGhost/Team/issues/553 This was introduced in https://github.com/TryGhost/Ghost/commit/79c3709f This migration has a `noop` for the down, as we never want to revert Ghost to a broken state
This commit is contained in:
parent
ba511445df
commit
8318391d4c
@ -4,6 +4,6 @@ const {
|
||||
|
||||
module.exports = addPermission({
|
||||
name: 'Backup database',
|
||||
action: 'backupContect',
|
||||
action: 'backupContent',
|
||||
object: 'db'
|
||||
});
|
||||
|
@ -0,0 +1,15 @@
|
||||
const logging = require('../../../../../shared/logging');
|
||||
const {createTransactionalMigration} = require('../../utils');
|
||||
|
||||
module.exports = createTransactionalMigration(async function up(knex) {
|
||||
const typoedPermission = await knex.select('*').from('permissions').where('action_type', 'backupContect').first();
|
||||
|
||||
if (!typoedPermission) {
|
||||
return logging.warn('Not updating permissions, no typo found');
|
||||
}
|
||||
|
||||
logging.info('Updating permissions, fixing typo by renaming "backupContect" to "backupContent"');
|
||||
await knex('permissions').update('action_type', 'backupContent').where('action_type', 'backupContect');
|
||||
}, async function down() {
|
||||
// noop
|
||||
});
|
Loading…
Reference in New Issue
Block a user