Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ghost/core/core/server/data/exporter/table-lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const BACKUP_TABLES = [
'collections_posts',
'recommendations',
'recommendation_click_events',
'recommendation_subscribe_events'
'recommendation_subscribe_events',
'outbox'
];

// NOTE: exposing only tables which are going to be included in a "default" export file
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const {addTable} = require('../../utils');

module.exports = addTable('outbox', {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
event_type: {type: 'string', maxlength: 50, nullable: false},
status: {type: 'string', maxlength: 20, nullable: false, defaultTo: 'pending'},
payload: {type: 'text', maxlength: 65535, nullable: false},
created_at: {type: 'dateTime', nullable: false},
retry_count: {type: 'integer', nullable: false, defaultTo: 0},
last_retry_at: {type: 'dateTime', nullable: true},
message: {type: 'string', maxlength: 2000, nullable: true}
});
10 changes: 10 additions & 0 deletions ghost/core/core/server/data/schema/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -1115,5 +1115,15 @@ module.exports = {
recommendation_id: {type: 'string', maxlength: 24, nullable: false, references: 'recommendations.id', unique: false, cascadeDelete: true},
member_id: {type: 'string', maxlength: 24, nullable: true, references: 'members.id', unique: false, setNullDelete: true},
created_at: {type: 'dateTime', nullable: false}
},
outbox: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
event_type: {type: 'string', maxlength: 50, nullable: false},
status: {type: 'string', maxlength: 20, nullable: false, defaultTo: 'pending'},
payload: {type: 'text', maxlength: 65535, nullable: false},
created_at: {type: 'dateTime', nullable: false},
retry_count: {type: 'integer', nullable: false, defaultTo: 0},
last_retry_at: {type: 'dateTime', nullable: true},
message: {type: 'string', maxlength: 2000, nullable: true}
}
};
1 change: 1 addition & 0 deletions ghost/core/test/integration/exporter/exporter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ describe('Exporter', function () {
'newsletters',
'offers',
'offer_redemptions',
'outbox',
'permissions',
'permissions_roles',
'permissions_users',
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 @@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
*/
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = 'aa00ea8206673b21837fbcc24897f779';
const currentSchemaHash = 'ad18b083839ac61306fd7dc57bf42cd1';
const currentFixturesHash = '0877727032b8beddbaedc086a8acf1a2';
const currentSettingsHash = 'bb8be7d83407f2b4fa2ad68c19610579';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
Expand Down