diff --git a/app/Console/Commands/Data/CleanStaleDataCommand.php b/app/Console/Commands/Data/CleanStaleDataCommand.php index 8c3bb0452..3f494f026 100644 --- a/app/Console/Commands/Data/CleanStaleDataCommand.php +++ b/app/Console/Commands/Data/CleanStaleDataCommand.php @@ -2,9 +2,18 @@ namespace App\Console\Commands; +//Internal Library use Illuminate\Console\Command; + +//Library use Commands\Library\CommandHelper; +//Models +use App\Models\Lookups\AllianceLookup; +use App\Models\Lookups\CharacterLookup; +use App\Models\Lookups\CorporationLookup; +use App\Models\Lookups\ItemLookup; + class CleanStaleDataCommand extends Command { /** @@ -40,5 +49,17 @@ class CleanStaleDataCommand extends Command { $command = new CommandHelper; $command->CleanJobStatusTable(); + + //Empty the item lookup table + ItemLookup::truncate(); + + //Empty the character lookup table + CharacterLookup::truncate(); + + //Empty the corporation lookup table + CorporationLookup::truncate(); + + //Empty the alliance lookup table + AllianceLookup::truncate(); } } diff --git a/app/Http/Controllers/Moons/MoonLedgerController.php b/app/Http/Controllers/Moons/MoonLedgerController.php index c32a291b2..d26fe2d80 100644 --- a/app/Http/Controllers/Moons/MoonLedgerController.php +++ b/app/Http/Controllers/Moons/MoonLedgerController.php @@ -23,7 +23,7 @@ use App\Models\Esi\EsiToken; use App\Models\Esi\EsiScope; use App\Models\Structure\Structure; use App\Models\Structure\Service; -use App\Models\Lookups\Item; +use App\Models\Lookups\ItemLookup; class MoonLedgerController extends Controller { diff --git a/app/Library/Lookups/NewLookupHelper.php b/app/Library/Lookups/NewLookupHelper.php index 3dd2713f3..54352bde9 100644 --- a/app/Library/Lookups/NewLookupHelper.php +++ b/app/Library/Lookups/NewLookupHelper.php @@ -21,7 +21,7 @@ use App\Models\Lookups\CharacterLookup; use App\Models\Lookups\CorporationLookup; use App\Models\Lookups\AllianceLookup; use App\Models\Lookups\SolarSystem; -use App\Models\Lookups\Item; +use App\Models\Lookups\ItemLookup; class NewLookupHelper { @@ -61,7 +61,7 @@ class NewLookupHelper { } private function LookupItem($itemId) { - $item = Item::where([ + $item = ItemLookup::where([ 'type_id' => $itemId, ])->first(); diff --git a/app/Models/Lookups/Item.php b/app/Models/Lookups/ItemLookup.php similarity index 95% rename from app/Models/Lookups/Item.php rename to app/Models/Lookups/ItemLookup.php index c45e6c2c7..89004ee7d 100644 --- a/app/Models/Lookups/Item.php +++ b/app/Models/Lookups/ItemLookup.php @@ -4,7 +4,7 @@ namespace App\Models\Lookups; use Illuminate\Database\Eloquent\Model; -class Item extends Model +class ItemLookup extends Model { /** * Table Name