mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added amp_gtag_id setting migration & default
refs #11980 This lays the ground for the rest of the work surrounding Google Analytics in AMP.
This commit is contained in:
parent
ced3e28d60
commit
48eca5f618
6 changed files with 28 additions and 1 deletions
|
@ -0,0 +1,20 @@
|
|||
const logging = require('../../../../../shared/logging');
|
||||
|
||||
module.exports = {
|
||||
config: {
|
||||
transaction: true
|
||||
},
|
||||
|
||||
async up({transacting: knex}) {
|
||||
logging.info('Updating amp_gtag_id setting to amp group');
|
||||
await knex('settings')
|
||||
.update({
|
||||
group: 'amp'
|
||||
})
|
||||
.where({
|
||||
key: 'amp_gtag_id'
|
||||
});
|
||||
},
|
||||
|
||||
async down() {}
|
||||
};
|
|
@ -337,6 +337,10 @@
|
|||
"isIn": [["true", "false"]]
|
||||
},
|
||||
"type": "boolean"
|
||||
},
|
||||
"amp_gtag_id": {
|
||||
"defaultValue": null,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"labs": {
|
||||
|
|
|
@ -56,6 +56,7 @@ const defaultSettingsKeyTypes = [
|
|||
{key: 'mailgun_domain', type: 'bulk_email'},
|
||||
{key: 'mailgun_base_url', type: 'bulk_email'},
|
||||
{key: 'amp', type: 'blog'},
|
||||
{key: 'amp_gtag_id', type: 'blog'},
|
||||
{key: 'labs', type: 'blog'},
|
||||
{key: 'slack', type: 'blog'},
|
||||
{key: 'unsplash', type: 'blog'},
|
||||
|
|
|
@ -53,6 +53,7 @@ const defaultSettingsKeyTypes = [
|
|||
{key: 'mailgun_domain', type: 'bulk_email'},
|
||||
{key: 'mailgun_base_url', type: 'bulk_email'},
|
||||
{key: 'amp', type: 'blog'},
|
||||
{key: 'amp_gtag_id', type: 'blog'},
|
||||
{key: 'labs', type: 'blog'},
|
||||
{key: 'slack', type: 'blog'},
|
||||
{key: 'unsplash', type: 'blog'},
|
||||
|
|
|
@ -56,6 +56,7 @@ const defaultSettingsKeys = [
|
|||
'mailgun_domain',
|
||||
'mailgun_base_url',
|
||||
'amp',
|
||||
'amp_gtag_id',
|
||||
'labs',
|
||||
'slack',
|
||||
'unsplash',
|
||||
|
|
|
@ -23,7 +23,7 @@ describe('DB version integrity', function () {
|
|||
// Only these variables should need updating
|
||||
const currentSchemaHash = '134c9de4e59b31ec6b73f03638a01396';
|
||||
const currentFixturesHash = '3d942c46e8487c4aee1e9ac898ed29ca';
|
||||
const currentSettingsHash = 'b0291920e168e74cf63a1919cd594fd6';
|
||||
const currentSettingsHash = 'a4ac78d3810175428b4833645231d6d5';
|
||||
|
||||
// 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…
Reference in a new issue