Skip to content

Commit 5b65db9

Browse files
committed
Added outbox table
1 parent 232bb32 commit 5b65db9

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

ghost/core/core/server/data/exporter/table-lists.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ const BACKUP_TABLES = [
5353
'collections_posts',
5454
'recommendations',
5555
'recommendation_click_events',
56-
'recommendation_subscribe_events'
56+
'recommendation_subscribe_events',
57+
'outbox'
5758
];
5859

5960
// NOTE: exposing only tables which are going to be included in a "default" export file
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const {addTable} = require('../../utils');
2+
3+
module.exports = addTable('outbox', {
4+
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
5+
event_type: {type: 'string', maxlength: 50, nullable: false},
6+
payload: {type: 'text', maxlength: 65535, nullable: false},
7+
created_at: {type: 'dateTime', nullable: false},
8+
retry_count: {type: 'integer', nullable: false, defaultTo: 0},
9+
last_retry_at: {type: 'dateTime', nullable: true}
10+
});

ghost/core/core/server/data/schema/schema.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,5 +1115,13 @@ module.exports = {
11151115
recommendation_id: {type: 'string', maxlength: 24, nullable: false, references: 'recommendations.id', unique: false, cascadeDelete: true},
11161116
member_id: {type: 'string', maxlength: 24, nullable: true, references: 'members.id', unique: false, setNullDelete: true},
11171117
created_at: {type: 'dateTime', nullable: false}
1118+
},
1119+
outbox: {
1120+
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
1121+
event_type: {type: 'string', maxlength: 50, nullable: false},
1122+
payload: {type: 'text', maxlength: 65535, nullable: false},
1123+
created_at: {type: 'dateTime', nullable: false},
1124+
retry_count: {type: 'integer', nullable: false, defaultTo: 0},
1125+
last_retry_at: {type: 'dateTime', nullable: true}
11181126
}
11191127
};

ghost/core/test/integration/exporter/exporter.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ describe('Exporter', function () {
6868
'newsletters',
6969
'offers',
7070
'offer_redemptions',
71+
'outbox',
7172
'permissions',
7273
'permissions_roles',
7374
'permissions_users',

ghost/core/test/unit/server/data/schema/integrity.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
3535
*/
3636
describe('DB version integrity', function () {
3737
// Only these variables should need updating
38-
const currentSchemaHash = 'aa00ea8206673b21837fbcc24897f779';
38+
const currentSchemaHash = '46790a2bcbfb8806ffab8ad25c3fbef4';
3939
const currentFixturesHash = '0877727032b8beddbaedc086a8acf1a2';
4040
const currentSettingsHash = 'bb8be7d83407f2b4fa2ad68c19610579';
4141
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';

0 commit comments

Comments
 (0)