mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Added Recommendations table (#17862)
closes https://github.com/TryGhost/Product/issues/3775 - Recommendations tech spec: https://www.notion.so/ghost/Recommentions-Tech-Spec-598f09e4109f4eef8d9e32db7245a90c?pvs=4#d59dd64cf40144bc944319b65436a730
This commit is contained in:
parent
c298dd5d38
commit
89e9e4a2b8
@ -50,7 +50,8 @@ const BACKUP_TABLES = [
|
||||
'email_spam_complaint_events',
|
||||
'milestones',
|
||||
'collections',
|
||||
'collections_posts'
|
||||
'collections_posts',
|
||||
'recommendations'
|
||||
];
|
||||
|
||||
// NOTE: exposing only tables which are going to be included in a "default" export file
|
||||
|
@ -0,0 +1,18 @@
|
||||
const {addTable} = require('../../utils');
|
||||
|
||||
module.exports = addTable('recommendations', {
|
||||
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
||||
|
||||
url: {type: 'string', maxlength: 2000, nullable: false},
|
||||
title: {type: 'string', maxlength: 2000, nullable: false},
|
||||
|
||||
excerpt: {type: 'string', maxlength: 2000, nullable: true},
|
||||
featured_image: {type: 'string', maxlength: 2000, nullable: true},
|
||||
favicon: {type: 'string', maxlength: 2000, nullable: true},
|
||||
|
||||
reason: {type: 'string', maxlength: 2000, nullable: true},
|
||||
one_click_subscribe: {type: 'boolean', nullable: false, defaultTo: false},
|
||||
|
||||
created_at: {type: 'dateTime', nullable: false},
|
||||
updated_at: {type: 'dateTime', nullable: true}
|
||||
});
|
@ -1067,5 +1067,17 @@ module.exports = {
|
||||
collection_id: {type: 'string', maxlength: 24, nullable: false, references: 'collections.id', cascadeDelete: true},
|
||||
post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id', cascadeDelete: true},
|
||||
sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
|
||||
},
|
||||
recommendations: {
|
||||
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
||||
url: {type: 'string', maxlength: 2000, nullable: false},
|
||||
title: {type: 'string', maxlength: 2000, nullable: false},
|
||||
excerpt: {type: 'string', maxlength: 2000, nullable: true},
|
||||
featured_image: {type: 'string', maxlength: 2000, nullable: true},
|
||||
favicon: {type: 'string', maxlength: 2000, nullable: true},
|
||||
reason: {type: 'string', maxlength: 2000, nullable: true},
|
||||
one_click_subscribe: {type: 'boolean', nullable: false, defaultTo: false},
|
||||
created_at: {type: 'dateTime', nullable: false},
|
||||
updated_at: {type: 'dateTime', nullable: true}
|
||||
}
|
||||
};
|
||||
|
@ -24,6 +24,7 @@ describe('Exporter', function () {
|
||||
const tables = [
|
||||
'actions',
|
||||
'api_keys',
|
||||
'benefits',
|
||||
'brute',
|
||||
'collections',
|
||||
'collections_posts',
|
||||
@ -41,28 +42,28 @@ describe('Exporter', function () {
|
||||
'invites',
|
||||
'jobs',
|
||||
'labels',
|
||||
'redirects',
|
||||
'members',
|
||||
'members_cancel_events',
|
||||
'members_click_events',
|
||||
'members_created_events',
|
||||
'members_email_change_events',
|
||||
'members_feedback',
|
||||
'members_labels',
|
||||
'members_click_events',
|
||||
'members_login_events',
|
||||
'members_newsletters',
|
||||
'members_paid_subscription_events',
|
||||
'members_payment_events',
|
||||
'members_product_events',
|
||||
'members_products',
|
||||
'members_status_events',
|
||||
'members_product_events',
|
||||
'members_stripe_customers',
|
||||
'members_stripe_customers_subscriptions',
|
||||
'members_subscribe_events',
|
||||
'members_created_events',
|
||||
'members_subscription_created_events',
|
||||
'mentions',
|
||||
'migrations',
|
||||
'migrations_lock',
|
||||
'milestones',
|
||||
'mobiledoc_revisions',
|
||||
'newsletters',
|
||||
'offers',
|
||||
@ -74,26 +75,26 @@ describe('Exporter', function () {
|
||||
'posts',
|
||||
'posts_authors',
|
||||
'posts_meta',
|
||||
'posts_tags',
|
||||
'posts_products',
|
||||
'posts_tags',
|
||||
'products',
|
||||
'benefits',
|
||||
'products_benefits',
|
||||
'stripe_products',
|
||||
'stripe_prices',
|
||||
'subscriptions',
|
||||
'suppressions',
|
||||
'recommendations',
|
||||
'redirects',
|
||||
'roles',
|
||||
'roles_users',
|
||||
'sessions',
|
||||
'settings',
|
||||
'snippets',
|
||||
'stripe_prices',
|
||||
'stripe_products',
|
||||
'subscriptions',
|
||||
'suppressions',
|
||||
'tags',
|
||||
'temp_mail_events',
|
||||
'tokens',
|
||||
'users',
|
||||
'webhooks',
|
||||
'milestones',
|
||||
'temp_mail_events'
|
||||
'webhooks'
|
||||
];
|
||||
|
||||
should.exist(exportData);
|
||||
|
@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
|
||||
*/
|
||||
describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = 'ad44bf95fee71a878704bff2a313a583';
|
||||
const currentSchemaHash = '5674764ca6518961a9b2917e7d8e2ea9';
|
||||
const currentFixturesHash = '31865c37aacfec9b8f16c1354b36a7de';
|
||||
const currentSettingsHash = 'dd0e318627ded65e41f188fb5bdf5b74';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
Loading…
Reference in New Issue
Block a user