File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -68,3 +68,15 @@ To export a remote database to OVERRIDE your local database by running:
68
68
``` bash
69
69
php artisan db:production-sync
70
70
```
71
+
72
+ Provide a filename for export on the fly by passing the option --filename, remember to provide .sql
73
+
74
+ ``` bash
75
+ php artisan db:production-sync --filename=other.sql
76
+ ```
77
+
78
+ Run the command without attempting to export:
79
+
80
+ ``` bash
81
+ php artisan db:production-sync --test
82
+ ```
Original file line number Diff line number Diff line change 7
7
8
8
class DbSyncCommand extends Command
9
9
{
10
- protected $ signature = 'db:production-sync {--test} ' ;
10
+ protected $ signature = 'db:production-sync {--test} {--filename=} ' ;
11
11
protected $ description = 'Sync production database with local ' ;
12
12
13
13
public function handle (): bool
@@ -31,7 +31,7 @@ public function handle(): bool
31
31
$ ignoreTables = explode (', ' , $ ignore );
32
32
$ importSqlFile = config ('dbsync.importSqlFile ' );
33
33
$ removeFileAfterImport = config ('dbsync.removeFileAfterImport ' );
34
- $ fileName = $ this ->argument ('filename ' ) ?? config ('dbsync.defaultFileName ' );
34
+ $ fileName = $ this ->option ('filename ' ) ?? config ('dbsync.defaultFileName ' );
35
35
36
36
if (empty ($ host ) || empty ($ username ) || empty ($ database )) {
37
37
$ this ->error ("DB credentials not set, have you published the config and set ENV variables? " );
You can’t perform that action at this time.
0 commit comments