mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Added comment_likes table creation migration
refs https://github.com/TryGhost/Team/issues/1664 - new table to handle likes on comments. This is not a join table, so it is comment_likes, rather than comments_likes
This commit is contained in:
parent
799a42062c
commit
959786b71f
@ -32,7 +32,8 @@ const BACKUP_TABLES = [
|
||||
'members_subscribe_events',
|
||||
'members_product_events',
|
||||
'members_newsletters',
|
||||
'comments'
|
||||
'comments',
|
||||
'comment_likes'
|
||||
];
|
||||
|
||||
// NOTE: exposing only tables which are going to be included in a "default" export file
|
||||
|
@ -0,0 +1,8 @@
|
||||
const {addTable} = require('../../utils');
|
||||
|
||||
module.exports = addTable('comment_likes', {
|
||||
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
||||
comment_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'comments.id', cascadeDelete: true},
|
||||
member_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'members.id'},
|
||||
created_at: {type: 'dateTime', nullable: false}
|
||||
});
|
@ -753,5 +753,12 @@ module.exports = {
|
||||
edited_at: {type: 'dateTime', nullable: true},
|
||||
created_at: {type: 'dateTime', nullable: false},
|
||||
updated_at: {type: 'dateTime', nullable: false}
|
||||
},
|
||||
comment_likes: {
|
||||
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
||||
comment_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'comments.id', cascadeDelete: true},
|
||||
member_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'members.id'},
|
||||
created_at: {type: 'dateTime', nullable: false},
|
||||
updated_at: {type: 'dateTime', nullable: false}
|
||||
}
|
||||
};
|
||||
|
@ -26,6 +26,7 @@ describe('Exporter', function () {
|
||||
'api_keys',
|
||||
'brute',
|
||||
'comments',
|
||||
'comment_likes',
|
||||
'custom_theme_settings',
|
||||
'email_batches',
|
||||
'email_recipients',
|
||||
|
@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
|
||||
*/
|
||||
describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = 'b582244f25b7e33b7cdda20427f79702';
|
||||
const currentSchemaHash = 'f762fe5aeec22dc6c8a204c9a5d3cc39';
|
||||
const currentFixturesHash = '1d6562a1963a9b9d10d06070d537f11f';
|
||||
const currentSettingsHash = '0b138cdd40e48b5b7dc4ebac2a7819a7';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
Loading…
Reference in New Issue
Block a user