Empty tables prior to import

This commit is contained in:
Leonard Smith 2020-10-07 11:05:24 -05:00
parent d64760b075
commit b329bed0d4
2 changed files with 8 additions and 18 deletions

View File

@ -4,6 +4,7 @@ namespace App\Console\Commands;
use App\Handlers\UlbXmlImportHandler;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class ImportUlbXmlData extends Command
{
@ -38,6 +39,13 @@ class ImportUlbXmlData extends Command
*/
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->run();
}

View File

@ -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);
}
}