mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
Added referrer attribution columns to events table (#15436)
refs TryGhost/Team#1931 - referrer source, medium and url will be stored in the events table along with rest of attribution data - stores referrer information on two tables - `members_created_events` for signups - `members_subscription_created_events` for paid conversions
This commit is contained in:
parent
fe46bd05fb
commit
b99c5428d0
@ -0,0 +1,21 @@
|
||||
const {createAddColumnMigration, combineNonTransactionalMigrations} = require('../../utils');
|
||||
|
||||
module.exports = combineNonTransactionalMigrations(
|
||||
createAddColumnMigration('members_created_events', 'referrer_source', {
|
||||
type: 'string',
|
||||
maxlength: 191,
|
||||
nullable: true
|
||||
}),
|
||||
|
||||
createAddColumnMigration('members_created_events', 'referrer_medium', {
|
||||
type: 'string',
|
||||
maxlength: 191,
|
||||
nullable: true
|
||||
}),
|
||||
|
||||
createAddColumnMigration('members_created_events', 'referrer_url', {
|
||||
type: 'string',
|
||||
maxlength: 2000,
|
||||
nullable: true
|
||||
})
|
||||
);
|
@ -0,0 +1,21 @@
|
||||
const {createAddColumnMigration, combineNonTransactionalMigrations} = require('../../utils');
|
||||
|
||||
module.exports = combineNonTransactionalMigrations(
|
||||
createAddColumnMigration('members_subscription_created_events', 'referrer_source', {
|
||||
type: 'string',
|
||||
maxlength: 191,
|
||||
nullable: true
|
||||
}),
|
||||
|
||||
createAddColumnMigration('members_subscription_created_events', 'referrer_medium', {
|
||||
type: 'string',
|
||||
maxlength: 191,
|
||||
nullable: true
|
||||
}),
|
||||
|
||||
createAddColumnMigration('members_subscription_created_events', 'referrer_url', {
|
||||
type: 'string',
|
||||
maxlength: 2000,
|
||||
nullable: true
|
||||
})
|
||||
);
|
@ -497,6 +497,9 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
attribution_url: {type: 'string', maxlength: 2000, nullable: true},
|
||||
referrer_source: {type: 'string', maxlength: 191, nullable: true},
|
||||
referrer_medium: {type: 'string', maxlength: 191, nullable: true},
|
||||
referrer_url: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source: {
|
||||
type: 'string', maxlength: 50, nullable: false, validations: {
|
||||
isIn: [['member', 'import', 'system', 'api', 'admin']]
|
||||
@ -634,7 +637,10 @@ module.exports = {
|
||||
isIn: [['url', 'post', 'page', 'author', 'tag']]
|
||||
}
|
||||
},
|
||||
attribution_url: {type: 'string', maxlength: 2000, nullable: true}
|
||||
attribution_url: {type: 'string', maxlength: 2000, nullable: true},
|
||||
referrer_source: {type: 'string', maxlength: 191, nullable: true},
|
||||
referrer_medium: {type: 'string', maxlength: 191, nullable: true},
|
||||
referrer_url: {type: 'string', maxlength: 2000, nullable: true}
|
||||
},
|
||||
offer_redemptions: {
|
||||
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
||||
|
@ -266,7 +266,7 @@ exports[`Members API - member attribution Returns sign up attributions in activi
|
||||
Object {
|
||||
"access-control-allow-origin": "http://127.0.0.1:2369",
|
||||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "8544",
|
||||
"content-length": "8874",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
@ -3546,7 +3546,7 @@ exports[`Members API Can subscribe to a newsletter 5: [headers] 1`] = `
|
||||
Object {
|
||||
"access-control-allow-origin": "http://127.0.0.1:2369",
|
||||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "4756",
|
||||
"content-length": "4822",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
|
@ -421,7 +421,7 @@ exports[`Members API Member attribution Returns subscription created attribution
|
||||
Object {
|
||||
"access-control-allow-origin": "http://127.0.0.1:2369",
|
||||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "13578",
|
||||
"content-length": "14106",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
|
@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
|
||||
*/
|
||||
describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = 'dbff9c0145b92f7c6b18af1029b8fe7e';
|
||||
const currentSchemaHash = '999d625400e6d87efe0fd66e6bda4059';
|
||||
const currentFixturesHash = '8cf221f0ed930ac1fe8030a58e60d64b';
|
||||
const currentSettingsHash = '2978a5684a2d5fcf089f61f5d368a0c0';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
Loading…
Reference in New Issue
Block a user