mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Added mentions database table (#16150)
closes https://github.com/TryGhost/Team/issues/2417 - added new `mentions` database table to be able to store incoming webmentions. - updated schema and tests to match.
This commit is contained in:
parent
8c9893e568
commit
3061fb2b3b
@ -37,6 +37,7 @@ const BACKUP_TABLES = [
|
||||
'members_created_events',
|
||||
'members_subscription_created_events',
|
||||
'members_newsletters',
|
||||
'mentions',
|
||||
'comments',
|
||||
'comment_likes',
|
||||
'comment_reports',
|
||||
|
@ -0,0 +1,17 @@
|
||||
const {addTable} = require('../../utils');
|
||||
|
||||
module.exports = addTable('mentions', {
|
||||
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
||||
source: {type: 'string', maxlength: 2000, nullable: false},
|
||||
source_title: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source_site_title: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source_excerpt: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source_author: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source_featured_image: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source_favicon: {type: 'string', maxlength: 2000, nullable: true},
|
||||
target: {type: 'string', maxlength: 2000, nullable: false},
|
||||
resource_id: {type: 'string', maxlength: 24, nullable: true},
|
||||
resource_type: {type: 'string', maxlength: 50, nullable: true},
|
||||
created_at: {type: 'dateTime', nullable: false},
|
||||
payload: {type: 'text', maxlength: 65535, nullable: true}
|
||||
});
|
@ -979,5 +979,20 @@ module.exports = {
|
||||
'@@UNIQUE_CONSTRAINTS@@': [
|
||||
['email_id', 'member_id']
|
||||
]
|
||||
},
|
||||
mentions: {
|
||||
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
||||
source: {type: 'string', maxlength: 2000, nullable: false},
|
||||
source_title: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source_site_title: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source_excerpt: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source_author: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source_featured_image: {type: 'string', maxlength: 2000, nullable: true},
|
||||
source_favicon: {type: 'string', maxlength: 2000, nullable: true},
|
||||
target: {type: 'string', maxlength: 2000, nullable: false},
|
||||
resource_id: {type: 'string', maxlength: 24, nullable: true},
|
||||
resource_type: {type: 'string', maxlength: 50, nullable: true},
|
||||
created_at: {type: 'dateTime', nullable: false},
|
||||
payload: {type: 'text', maxlength: 65535, nullable: true}
|
||||
}
|
||||
};
|
||||
|
@ -57,6 +57,7 @@ describe('Exporter', function () {
|
||||
'members_subscribe_events',
|
||||
'members_created_events',
|
||||
'members_subscription_created_events',
|
||||
'mentions',
|
||||
'migrations',
|
||||
'migrations_lock',
|
||||
'mobiledoc_revisions',
|
||||
|
@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
|
||||
*/
|
||||
describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = 'a3df9e11b3db1c8afdfb87c7a206b53b';
|
||||
const currentSchemaHash = '8eab51dd80562c92215283df89b0200b';
|
||||
const currentFixturesHash = 'f0ccdb0c7eccbc3311e38b5d145ed1db';
|
||||
const currentSettingsHash = '9acce72858e75420b831297718595bbd';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
Loading…
Reference in New Issue
Block a user