mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +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',
|
'email_spam_complaint_events',
|
||||||
'milestones',
|
'milestones',
|
||||||
'collections',
|
'collections',
|
||||||
'collections_posts'
|
'collections_posts',
|
||||||
|
'recommendations'
|
||||||
];
|
];
|
||||||
|
|
||||||
// NOTE: exposing only tables which are going to be included in a "default" export file
|
// 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},
|
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},
|
post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id', cascadeDelete: true},
|
||||||
sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
|
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 = [
|
const tables = [
|
||||||
'actions',
|
'actions',
|
||||||
'api_keys',
|
'api_keys',
|
||||||
|
'benefits',
|
||||||
'brute',
|
'brute',
|
||||||
'collections',
|
'collections',
|
||||||
'collections_posts',
|
'collections_posts',
|
||||||
@ -41,28 +42,28 @@ describe('Exporter', function () {
|
|||||||
'invites',
|
'invites',
|
||||||
'jobs',
|
'jobs',
|
||||||
'labels',
|
'labels',
|
||||||
'redirects',
|
|
||||||
'members',
|
'members',
|
||||||
'members_cancel_events',
|
'members_cancel_events',
|
||||||
|
'members_click_events',
|
||||||
|
'members_created_events',
|
||||||
'members_email_change_events',
|
'members_email_change_events',
|
||||||
'members_feedback',
|
'members_feedback',
|
||||||
'members_labels',
|
'members_labels',
|
||||||
'members_click_events',
|
|
||||||
'members_login_events',
|
'members_login_events',
|
||||||
'members_newsletters',
|
'members_newsletters',
|
||||||
'members_paid_subscription_events',
|
'members_paid_subscription_events',
|
||||||
'members_payment_events',
|
'members_payment_events',
|
||||||
|
'members_product_events',
|
||||||
'members_products',
|
'members_products',
|
||||||
'members_status_events',
|
'members_status_events',
|
||||||
'members_product_events',
|
|
||||||
'members_stripe_customers',
|
'members_stripe_customers',
|
||||||
'members_stripe_customers_subscriptions',
|
'members_stripe_customers_subscriptions',
|
||||||
'members_subscribe_events',
|
'members_subscribe_events',
|
||||||
'members_created_events',
|
|
||||||
'members_subscription_created_events',
|
'members_subscription_created_events',
|
||||||
'mentions',
|
'mentions',
|
||||||
'migrations',
|
'migrations',
|
||||||
'migrations_lock',
|
'migrations_lock',
|
||||||
|
'milestones',
|
||||||
'mobiledoc_revisions',
|
'mobiledoc_revisions',
|
||||||
'newsletters',
|
'newsletters',
|
||||||
'offers',
|
'offers',
|
||||||
@ -74,26 +75,26 @@ describe('Exporter', function () {
|
|||||||
'posts',
|
'posts',
|
||||||
'posts_authors',
|
'posts_authors',
|
||||||
'posts_meta',
|
'posts_meta',
|
||||||
'posts_tags',
|
|
||||||
'posts_products',
|
'posts_products',
|
||||||
|
'posts_tags',
|
||||||
'products',
|
'products',
|
||||||
'benefits',
|
|
||||||
'products_benefits',
|
'products_benefits',
|
||||||
'stripe_products',
|
'recommendations',
|
||||||
'stripe_prices',
|
'redirects',
|
||||||
'subscriptions',
|
|
||||||
'suppressions',
|
|
||||||
'roles',
|
'roles',
|
||||||
'roles_users',
|
'roles_users',
|
||||||
'sessions',
|
'sessions',
|
||||||
'settings',
|
'settings',
|
||||||
'snippets',
|
'snippets',
|
||||||
|
'stripe_prices',
|
||||||
|
'stripe_products',
|
||||||
|
'subscriptions',
|
||||||
|
'suppressions',
|
||||||
'tags',
|
'tags',
|
||||||
|
'temp_mail_events',
|
||||||
'tokens',
|
'tokens',
|
||||||
'users',
|
'users',
|
||||||
'webhooks',
|
'webhooks'
|
||||||
'milestones',
|
|
||||||
'temp_mail_events'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
should.exist(exportData);
|
should.exist(exportData);
|
||||||
|
@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
|
|||||||
*/
|
*/
|
||||||
describe('DB version integrity', function () {
|
describe('DB version integrity', function () {
|
||||||
// Only these variables should need updating
|
// Only these variables should need updating
|
||||||
const currentSchemaHash = 'ad44bf95fee71a878704bff2a313a583';
|
const currentSchemaHash = '5674764ca6518961a9b2917e7d8e2ea9';
|
||||||
const currentFixturesHash = '31865c37aacfec9b8f16c1354b36a7de';
|
const currentFixturesHash = '31865c37aacfec9b8f16c1354b36a7de';
|
||||||
const currentSettingsHash = 'dd0e318627ded65e41f188fb5bdf5b74';
|
const currentSettingsHash = 'dd0e318627ded65e41f188fb5bdf5b74';
|
||||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||||
|
Loading…
Reference in New Issue
Block a user