mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
Added the emails-newsletters relation (#14434)
refs https://github.com/TryGhost/Team/issues/1497 - This enables us to keep track of which newsletter an email was sent to even if the related post is deleted. - Adds the `newsletter_id` property to the email API
This commit is contained in:
parent
b0df387deb
commit
1ba72edce6
@ -0,0 +1,8 @@
|
||||
const {createAddColumnMigration} = require('../../utils');
|
||||
|
||||
module.exports = createAddColumnMigration('emails', 'newsletter_id', {
|
||||
type: 'string',
|
||||
maxlength: 24,
|
||||
nullable: true,
|
||||
references: 'newsletters.id'
|
||||
});
|
@ -660,6 +660,7 @@ module.exports = {
|
||||
plaintext: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
||||
track_opens: {type: 'bool', nullable: false, defaultTo: false},
|
||||
submitted_at: {type: 'dateTime', nullable: false},
|
||||
newsletter_id: {type: 'string', maxlength: 24, nullable: true, references: 'newsletters.id'},
|
||||
created_at: {type: 'dateTime', nullable: false},
|
||||
created_by: {type: 'string', maxlength: 24, nullable: false},
|
||||
updated_at: {type: 'dateTime', nullable: true},
|
||||
|
@ -13,6 +13,7 @@ Object {
|
||||
"from": null,
|
||||
"html": "<p>Look! I'm an email</p>",
|
||||
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
||||
"newsletter_id": null,
|
||||
"opened_count": 0,
|
||||
"plaintext": "Waba-daba-dab-da",
|
||||
"post_id": "618ba1ffbe2896088840a6df",
|
||||
@ -35,6 +36,7 @@ Object {
|
||||
"from": null,
|
||||
"html": "<p>What's that? Another email!</p>",
|
||||
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
||||
"newsletter_id": null,
|
||||
"opened_count": 0,
|
||||
"plaintext": "yes this is an email",
|
||||
"post_id": "618ba1ffbe2896088840a6e1",
|
||||
@ -65,7 +67,7 @@ exports[`Emails API Can browse emails 2: [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": "1201",
|
||||
"content-length": "1243",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
@ -86,6 +88,7 @@ Object {
|
||||
"from": null,
|
||||
"html": "<p>Look! I'm an email</p>",
|
||||
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
||||
"newsletter_id": null,
|
||||
"opened_count": 0,
|
||||
"plaintext": "Waba-daba-dab-da",
|
||||
"post_id": "618ba1ffbe2896088840a6df",
|
||||
@ -106,7 +109,7 @@ exports[`Emails API Can read an email 2: [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": "540",
|
||||
"content-length": "561",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
@ -127,6 +130,7 @@ Object {
|
||||
"from": null,
|
||||
"html": "<p>What's that? Another email!</p>",
|
||||
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
||||
"newsletter_id": null,
|
||||
"opened_count": 0,
|
||||
"plaintext": "yes this is an email",
|
||||
"post_id": "618ba1ffbe2896088840a6e1",
|
||||
@ -147,7 +151,7 @@ exports[`Emails API Can retry a failed email 2: [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": "586",
|
||||
"content-length": "607",
|
||||
"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 = 'fd27b0a1e11dbcea38a333547ec57355';
|
||||
const currentSchemaHash = '782afa7e2a808fc79fcb797ae9bfa601';
|
||||
const currentFixturesHash = 'f4dd2a454e1999b6d149cc26ae52ced4';
|
||||
const currentSettingsHash = '71fa38d0c805c18ceebe0fda80886230';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
Loading…
Reference in New Issue
Block a user