forked from WycliffeAssociates/en_btr_backend
Empty tables prior to import
This commit is contained in:
parent
d64760b075
commit
b329bed0d4
|
@ -4,6 +4,7 @@ namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Handlers\UlbXmlImportHandler;
|
use App\Handlers\UlbXmlImportHandler;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class ImportUlbXmlData extends Command
|
class ImportUlbXmlData extends Command
|
||||||
{
|
{
|
||||||
|
@ -38,6 +39,13 @@ class ImportUlbXmlData extends Command
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
DB::statement("SET FOREIGN_KEY_CHECKS=0");
|
||||||
|
DB::table('verses')->truncate();
|
||||||
|
DB::table('chapters')->truncate();
|
||||||
|
DB::table('books')->truncate();
|
||||||
|
DB::table('words')->truncate();
|
||||||
|
DB::statement("SET FOREIGN_KEY_CHECKS=1");
|
||||||
|
|
||||||
$importHandler = new UlbXmlImportHandler();
|
$importHandler = new UlbXmlImportHandler();
|
||||||
$importHandler->run();
|
$importHandler->run();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Unit;
|
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
|
|
||||||
class ExampleTest extends TestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* A basic test example.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function testBasicTest()
|
|
||||||
{
|
|
||||||
$this->assertTrue(true);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue