partial update fix sync data pbg
This commit is contained in:
40
app/Console/Commands/TruncatePBGTable.php
Normal file
40
app/Console/Commands/TruncatePBGTable.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\PbgTask;
|
||||
use App\Models\PbgTaskAttachment;
|
||||
use App\Models\PbgTaskDetail;
|
||||
use App\Models\PbgTaskRetributions;
|
||||
use DB;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class TruncatePBGTable extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'app:truncate-pbg-table';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
|
||||
PbgTask::truncate();
|
||||
PbgTaskAttachment::truncate();
|
||||
PbgTaskRetributions::truncate();
|
||||
PbgTaskDetail::truncate();
|
||||
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user