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'),