Skip to content

Commit

Permalink
Added migration for new settings keys
Browse files Browse the repository at this point in the history
  • Loading branch information
aileen committed Oct 17, 2024
1 parent 0e10f50 commit 10467c6
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ const EDITABLE_SETTINGS = [
'pintura_css_url',
'donations_currency',
'donations_suggested_amount',
'recommendations_enabled'
'recommendations_enabled',
'body_font',
'heading_font'
];

module.exports = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const {addSetting} = require('../../utils');

module.exports = addSetting({
key: 'body_font',
value: '',
type: 'string',
group: 'site'
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const {addSetting} = require('../../utils');

module.exports = addSetting({
key: 'heading_font',
value: '',
type: 'string',
group: 'site'
});
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
"flags": "PUBLIC",
"type": "string"
},
"heading_font": {
"defaultValue": "",
"type": "string"
},
"body_font": {
"defaultValue": "",
"type": "string"
},
"logo": {
"defaultValue": "",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion ghost/core/test/unit/server/data/exporter/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ describe('Exporter', function () {

// NOTE: if default settings changed either modify the settings keys blocklist or increase allowedKeysLength
// This is a reminder to think about the importer/exporter scenarios ;)
const allowedKeysLength = 86;
const allowedKeysLength = 88;
totalKeysLength.should.eql(SETTING_KEYS_BLOCKLIST.length + allowedKeysLength);
});
});
Expand Down
2 changes: 1 addition & 1 deletion ghost/core/test/unit/server/data/schema/integrity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = 'a4f016480ff73c6f52ee4c86482b45a7';
const currentFixturesHash = '475f488105c390bb0018db90dce845f1';
const currentSettingsHash = '051ef2a50e2edb8723e89461448313cb';
const currentSettingsHash = '47a75e8898fab270174a0c905cb3e914';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';

// If this test is failing, then it is likely a change has been made that requires a DB version bump,
Expand Down

0 comments on commit 10467c6

Please sign in to comment.