From cb30c9bbc9e9d3fa276176d28ab4054960f6ffd6 Mon Sep 17 00:00:00 2001 From: Sam Lord Date: Wed, 3 May 2023 16:28:24 +0100 Subject: [PATCH] Prevent posts_meta data from killing the data-generator process no issue --- ghost/data-generator/lib/data-generator.js | 2 ++ ghost/data-generator/lib/tables/index.js | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ghost/data-generator/lib/data-generator.js b/ghost/data-generator/lib/data-generator.js index 83f1d0df9a..94f57fbec3 100644 --- a/ghost/data-generator/lib/data-generator.js +++ b/ghost/data-generator/lib/data-generator.js @@ -99,6 +99,8 @@ class DataGenerator { // List of tables ordered to avoid dependencies when deleting const tableNames = Object.values(tables).map(importer => importer.table).reverse(); + // We don't currently generate posts_meta, but we need to clear it to ensure posts can be removed + tableNames.unshift('posts_meta'); for (const table of tableNames) { this.logger.debug(`Clearing table ${table}`); if (table === 'roles_users') { diff --git a/ghost/data-generator/lib/tables/index.js b/ghost/data-generator/lib/tables/index.js index b425018691..69753ce58e 100644 --- a/ghost/data-generator/lib/tables/index.js +++ b/ghost/data-generator/lib/tables/index.js @@ -18,6 +18,11 @@ module.exports = { StripePricesImporter: require('./stripe-prices'), SubscriptionsImporter: require('./subscriptions'), EmailsImporter: require('./emails'), + EmailBatchesImporter: require('./email-batches'), + EmailRecipientsImporter: require('./email-recipients'), + RedirectsImporter: require('./redirects'), + MembersClickEventsImporter: require('./members-click-events'), + OffersImporter: require('./offers'), MembersCreatedEventsImporter: require('./members-created-events'), MembersLoginEventsImporter: require('./members-login-events'), MembersStatusEventsImporter: require('./members-status-events'), @@ -26,11 +31,6 @@ module.exports = { MembersPaidSubscriptionEventsImporter: require('./members-paid-subscription-events'), MembersSubscriptionCreatedEventsImporter: require('./members-subscription-created-events'), MembersSubscribeEventsImporter: require('./members-subscribe-events'), - EmailBatchesImporter: require('./email-batches'), - EmailRecipientsImporter: require('./email-recipients'), - RedirectsImporter: require('./redirects'), - MembersClickEventsImporter: require('./members-click-events'), - OffersImporter: require('./offers'), LabelsImporter: require('./labels'), MembersLabelsImporter: require('./members-labels'), RolesUsersImporter: require('./roles-users'),