diff --git a/ghost/data-generator/lib/importers/EmailsImporter.js b/ghost/data-generator/lib/importers/EmailsImporter.js index eb867ed331..81921b322f 100644 --- a/ghost/data-generator/lib/importers/EmailsImporter.js +++ b/ghost/data-generator/lib/importers/EmailsImporter.js @@ -14,7 +14,7 @@ class EmailsImporter extends TableImporter { async import(quantity) { const posts = await this.transaction.select('id', 'title', 'published_at').from('posts').where('type', 'post'); - this.newsletters = await this.transaction.select('id').from('newsletters'); + this.newsletters = await this.transaction.select('id').from('newsletters').orderBy('sort_order'); this.membersSubscribeEvents = await this.transaction.select('id', 'newsletter_id', 'created_at').from('members_subscribe_events'); await this.importForEach(posts, quantity ? quantity / posts.length : 1); diff --git a/ghost/data-generator/lib/importers/MembersImporter.js b/ghost/data-generator/lib/importers/MembersImporter.js index beb1e20945..ba6c30bd53 100644 --- a/ghost/data-generator/lib/importers/MembersImporter.js +++ b/ghost/data-generator/lib/importers/MembersImporter.js @@ -70,7 +70,7 @@ class MembersImporter extends TableImporter { return { id, uuid: faker.datatype.uuid(), - email: faker.internet.email(name, faker.date.birthdate().getFullYear().toString(), 'example.com').toLowerCase(), + email: `${name.replace(' ', '.').replace(/[^a-zA-Z0-9]/g, '').toLowerCase()}${faker.datatype.number({min: 1000, max: 9999})}@example.com`, status: luck(5) ? 'comped' : luck(25) ? 'paid' : 'free', name: name, expertise: luck(30) ? faker.name.jobTitle() : undefined, diff --git a/ghost/data-generator/lib/importers/MembersSubscribeEventsImporter.js b/ghost/data-generator/lib/importers/MembersSubscribeEventsImporter.js index bcde10d0f0..d46a3782a4 100644 --- a/ghost/data-generator/lib/importers/MembersSubscribeEventsImporter.js +++ b/ghost/data-generator/lib/importers/MembersSubscribeEventsImporter.js @@ -13,7 +13,7 @@ class MembersSubscribeEventsImporter extends TableImporter { async import(quantity) { const members = await this.transaction.select('id', 'created_at', 'status').from('members'); - this.newsletters = await this.transaction.select('id').from('newsletters'); + this.newsletters = await this.transaction.select('id').from('newsletters').orderBy('sort_order'); this.subscriptions = await this.transaction.select('member_id', 'created_at').from('subscriptions'); await this.importForEach(members, quantity ? quantity / members.length : 2); diff --git a/ghost/data-generator/lib/importers/PostsImporter.js b/ghost/data-generator/lib/importers/PostsImporter.js index f0844f6d42..ee3500c550 100644 --- a/ghost/data-generator/lib/importers/PostsImporter.js +++ b/ghost/data-generator/lib/importers/PostsImporter.js @@ -19,7 +19,7 @@ class PostsImporter extends TableImporter { } async import(quantity = this.defaultQuantity) { - this.newsletters = await this.transaction.select('id').from('newsletters'); + this.newsletters = await this.transaction.select('id').from('newsletters').orderBy('sort_order'); await super.import(quantity); }