mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Added routes_hash setting (#12171)
refs #11999 - The `routes_hash` setting will be used during the boot process to update the hash of currently loaded routes.yaml file in case it's different from last restart
This commit is contained in:
parent
4606c93e4f
commit
fcc6401445
4 changed files with 28 additions and 3 deletions
|
@ -0,0 +1,20 @@
|
|||
const logging = require('../../../../../shared/logging');
|
||||
module.exports = {
|
||||
config: {
|
||||
transaction: true
|
||||
},
|
||||
|
||||
async up({transacting: knex}) {
|
||||
logging.info('Updating routes_hash to group: core, type: string, flags: null');
|
||||
|
||||
await knex('settings')
|
||||
.update({
|
||||
group: 'core',
|
||||
type: 'string',
|
||||
flags: null
|
||||
})
|
||||
.where('key', 'routes_hash');
|
||||
},
|
||||
|
||||
async down() {}
|
||||
};
|
|
@ -4,6 +4,10 @@
|
|||
"defaultValue": null,
|
||||
"type": "string"
|
||||
},
|
||||
"routes_hash": {
|
||||
"defaultValue": null,
|
||||
"type": "string"
|
||||
},
|
||||
"next_update_check": {
|
||||
"defaultValue": null,
|
||||
"type": "number"
|
||||
|
|
|
@ -15,9 +15,10 @@ describe('Settings', function () {
|
|||
return testUtils.startGhost();
|
||||
});
|
||||
|
||||
// Whitelist: Only this list needs updating when a core setting is added/removed/renamed
|
||||
// Allowlist: Only this list needs updating when a core setting is added/removed/renamed
|
||||
const coreSettingKeys = [
|
||||
'db_hash',
|
||||
'routes_hash',
|
||||
'next_update_check',
|
||||
'notifications',
|
||||
'session_secret',
|
||||
|
@ -31,7 +32,7 @@ describe('Settings', function () {
|
|||
'members_stripe_webhook_secret'
|
||||
];
|
||||
// If this test is failing, then it is likely a new setting has been added without group migration
|
||||
// In case of `core` setting modifications, whitelist above needs to be updated
|
||||
// In case of `core` setting modifications, allowlist above needs to be updated
|
||||
it('should not modify core keys without fixing this test', function () {
|
||||
return db.knex('settings')
|
||||
.where('group', 'core')
|
||||
|
|
|
@ -23,7 +23,7 @@ describe('DB version integrity', function () {
|
|||
// Only these variables should need updating
|
||||
const currentSchemaHash = '42a966364eb4b5851e807133374821da';
|
||||
const currentFixturesHash = '29148c40dfaf4f828c5fca95666f6545';
|
||||
const currentSettingsHash = 'a079e294592f6effe0738e671d053e20';
|
||||
const currentSettingsHash = 'c8daa2c9632bb75f9d60655de09ae3bd';
|
||||
|
||||
// If this test is failing, then it is likely a change has been made that requires a DB version bump,
|
||||
// and the values above will need updating as confirmation
|
||||
|
|
Loading…
Add table
Reference in a new issue