Prevent posts_meta data from killing the data-generator process

no issue
This commit is contained in:
Sam Lord 2023-05-03 16:28:24 +01:00
parent 84c6c0397b
commit cb30c9bbc9
2 changed files with 7 additions and 5 deletions

View File

@ -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') {

View File

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