Skip to content

Commit ace0245

Browse files
authored
Merge pull request #627 from Laravel-Backpack/seeders-fixes
Removes the truncates and reduce the amount of seeded data
2 parents 865e52a + b580586 commit ace0245

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

database/seeders/DatabaseSeeder.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,37 +35,26 @@ public function run()
3535
]);
3636

3737
// Faker factories
38-
Recommend::truncate();
3938
Recommend::factory()->count(30)->create();
4039

41-
PostalBoxer::truncate();
4240
PostalBoxer::factory()->count(30)->create();
4341

44-
Bill::truncate();
4542
Bill::factory()->count(30)->create();
4643

47-
Tag::truncate();
4844
Tag::factory()->count(21)->create();
4945

50-
Category::truncate();
5146
Category::factory()->count(40)->create();
5247

53-
Article::truncate();
5448
Article::factory()->count(1031)->create();
5549

56-
Product::truncate();
5750
Product::factory()->count(210)->create();
5851

59-
Monster::truncate();
6052
Monster::factory()->count(140)->create();
6153

62-
Page::truncate();
6354
Page::factory()->count(16)->create();
6455

65-
MenuItem::truncate();
6656
MenuItem::factory()->count(7)->create();
6757

68-
Meeting::truncate();
6958
Meeting::factory()->count(50)->create();
7059
}
7160
}

database/seeders/MillionCommentsSeeder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ public function run()
3232
DB::disableQueryLog();
3333
DB::beginTransaction();
3434

35-
for ($i = 1; $i <= 1000; $i++) {
35+
for ($i = 1; $i <= 100; $i++) {
3636
$body = $this->faker->text;
3737
$commentable = $i % 2 == 0 ? $this->owners->random() : $this->pets->random();
3838
$commentable_type = get_class($commentable);
3939
$commentable_id = $commentable->getKey();
4040

41-
$comments = array_fill(0, 1000, [
41+
$comments = array_fill(0, 100, [
4242
'body' => $body,
4343
'commentable_type' => $commentable_type,
4444
'commentable_id' => $commentable_id,

0 commit comments

Comments
 (0)