mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Added recipient_filter column to emails table
no-issue This column will allow us to store the canonical recipient filter on the email resource giving us a detailed log of which members an email was intended for
This commit is contained in:
parent
dd0f80c9fa
commit
918c721bd1
4 changed files with 34 additions and 1 deletions
|
@ -0,0 +1,25 @@
|
||||||
|
const {createColumnMigration, addColumn, dropColumn} = require('../../../schema/commands');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
up: createColumnMigration({
|
||||||
|
table: 'emails',
|
||||||
|
column: 'recipient_filter',
|
||||||
|
dbIsInCorrectState: hasColumn => !!hasColumn,
|
||||||
|
operation: addColumn,
|
||||||
|
operationVerb: 'Adding',
|
||||||
|
columnDefinition: {
|
||||||
|
type: 'string',
|
||||||
|
maxlength: 50,
|
||||||
|
nullable: false,
|
||||||
|
defaultTo: 'paid',
|
||||||
|
validations: {isIn: [['all', 'free', 'paid']]}
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
down: createColumnMigration({
|
||||||
|
table: 'emails',
|
||||||
|
column: 'recipient_filter',
|
||||||
|
dbIsInCorrectState: hasColumn => !hasColumn,
|
||||||
|
operation: dropColumn,
|
||||||
|
operationVerb: 'Removing'
|
||||||
|
})
|
||||||
|
};
|
|
@ -453,6 +453,13 @@ module.exports = {
|
||||||
defaultTo: 'pending',
|
defaultTo: 'pending',
|
||||||
validations: {isIn: [['pending', 'submitting', 'submitted', 'failed']]}
|
validations: {isIn: [['pending', 'submitting', 'submitted', 'failed']]}
|
||||||
},
|
},
|
||||||
|
recipient_filter: {
|
||||||
|
type: 'string',
|
||||||
|
maxlength: 50,
|
||||||
|
nullable: false,
|
||||||
|
defaultTo: 'paid',
|
||||||
|
validations: {isIn: [['all', 'free', 'paid']]}
|
||||||
|
},
|
||||||
error: {type: 'string', maxlength: 2000, nullable: true},
|
error: {type: 'string', maxlength: 2000, nullable: true},
|
||||||
error_data: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
error_data: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
||||||
meta: {type: 'text', maxlength: 65535, nullable: true},
|
meta: {type: 'text', maxlength: 65535, nullable: true},
|
||||||
|
|
|
@ -8,6 +8,7 @@ const Email = ghostBookshelf.Model.extend({
|
||||||
return {
|
return {
|
||||||
uuid: uuid.v4(),
|
uuid: uuid.v4(),
|
||||||
status: 'pending',
|
status: 'pending',
|
||||||
|
recipient_filter: 'paid',
|
||||||
stats: JSON.stringify({
|
stats: JSON.stringify({
|
||||||
delivered: 0,
|
delivered: 0,
|
||||||
failed: 0,
|
failed: 0,
|
||||||
|
|
|
@ -32,7 +32,7 @@ const defaultSettings = require('../../../../core/server/data/schema/default-set
|
||||||
*/
|
*/
|
||||||
describe('DB version integrity', function () {
|
describe('DB version integrity', function () {
|
||||||
// Only these variables should need updating
|
// Only these variables should need updating
|
||||||
const currentSchemaHash = '7d841714b01e6d880d4d8a739ab62bff';
|
const currentSchemaHash = '875ecd7995d0dccdbc0ae64be8dfbca0';
|
||||||
const currentFixturesHash = 'd46d696c94d03e41a5903500547fea77';
|
const currentFixturesHash = 'd46d696c94d03e41a5903500547fea77';
|
||||||
const currentSettingsHash = 'c8daa2c9632bb75f9d60655de09ae3bd';
|
const currentSettingsHash = 'c8daa2c9632bb75f9d60655de09ae3bd';
|
||||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||||
|
|
Loading…
Add table
Reference in a new issue