File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to ` laravel-useful-additions ` will be documented in this file.
44
5+ ## v3.2.0 - 2023-03-12
6+
7+ Added options for ` db:truncate ` command.
8+
59## v3.1.0 - 2023-03-12
610
711Added ` db:truncate ` command
Original file line number Diff line number Diff line change @@ -168,19 +168,22 @@ class MyTest extends TestCase
168168
169169---
170170
171- This command truncates all the tables of your current database connection:
171+ This command truncates all the tables of your current database connection. Checkout ` --help ` to see arguments and options.
172+ It for instance, lets you also truncate only ** specific** tables or disable ** foreigen key checks** or maybe run in ** force** mode.
172173
173174``` bash
174175php artisan db:truncate
175176```
176177```
177- INFO Preparing database .
178+ INFO Start truncating tables .
178179
179180Truncating table: failed_jobs .............................................. 135ms DONE
180181Truncating table: migrations ................................................ 87ms DONE
181182Truncating table: password_reset_tokens ..................................... 79ms DONE
182183Truncating table: personal_access_tokens .................................... 86ms DONE
183184Truncating table: users ..................................................... 78ms DONE
185+
186+ INFO Finished truncating tables.
184187```
185188
186189## Testing
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public function handle(): int
2525
2626 $ foreignKeyChecks = $ this ->hasOption ('checks ' ) && filter_var ($ this ->option ('checks ' ), FILTER_VALIDATE_BOOLEAN );
2727
28- if (!$ foreignKeyChecks ) {
28+ if (! $ foreignKeyChecks ) {
2929 $ this ->components ->warn ('Disabling foreign key checks! ' );
3030 Schema::disableForeignKeyConstraints ();
3131 }
@@ -46,7 +46,7 @@ public function handle(): int
4646
4747 $ this ->components ->info ('Finished truncating tables. ' );
4848
49- if (!$ foreignKeyChecks ) {
49+ if (! $ foreignKeyChecks ) {
5050 $ this ->components ->warn ('Re-enabling foreign key checks! ' );
5151 Schema::enableForeignKeyConstraints ();
5252 }
You can’t perform that action at this time.
0 commit comments