Skip to content

Commit b897fd1

Browse files
committed
call the truncate method instead of delete from seeder.
1 parent efd2044 commit b897fd1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Illuminate/Database/Seeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function seed(Connection $connection, $path)
5959
// the databases via a connection and fire an event noting the seeding.
6060
$table = $this->getTable($records, $file);
6161

62-
$connection->table($table)->delete();
62+
$connection->table($table)->truncate();
6363

6464
$connection->table($table)->insert($records);
6565

tests/Database/DatabaseSeederTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function testTablesAreSeededFromSeedFiles()
2020
$connection = m::mock('Illuminate\Database\Connection');
2121
$table = m::mock('Illuminate\Database\Query\Builder');
2222
$connection->shouldReceive('table')->with('a_table')->andReturn($table);
23-
$table->shouldReceive('delete')->twice();
23+
$table->shouldReceive('truncate')->twice();
2424
$table->shouldReceive('insert')->once()->with(array(array('name' => 'Taylor')));
2525
$connection->shouldReceive('table')->with('b')->andReturn($table);
2626
$table->shouldReceive('insert')->once()->with(array(array('name' => 'Dayle')));

0 commit comments

Comments
 (0)