Skip to content

Commit 2e4b07b

Browse files
committed
Use table truncate() instead of raw DELETE for idempotent seed
1 parent 9a48a9d commit 2e4b07b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

config/Seeds/CountriesSeed.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ public function run(): void {
3737
}
3838
fclose($handle);
3939

40-
$this->execute('DELETE FROM countries');
41-
4240
$table = $this->table('countries');
41+
$table->truncate();
4342
$table->insert($rows)->save();
4443
}
4544

0 commit comments

Comments
 (0)