alliance fleet tables and models

This commit is contained in:
2020-04-07 23:47:35 -05:00
parent 2d6989ed1c
commit 861f3654d2
6 changed files with 138 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Library\Fleets;
//Internal Libraries
use Log;
//Seat Stuff
use Seat\Eseye\Cache\NullCache;
use Seat\Eseye\Configuration;
use Seat\Eseye\Containers\EsiAuthentication;
use Seat\Eseye\Eseye;
use Seat\Eseye\Exceptions\RequestFailedException;
//Libraries
use App\library\Esi\Esi;
//Models
?>

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Models\Fleets;
use Illuminate\Database\Eloquent\Model;
class AllianceFleet extends Model
{
/**
* Table Name
*/
protected $table = 'alliance_fleets';
/**
* Timestamps
*/
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'fleet_id',
'fleet_commander_id',
'fleet_commander_name',
'member_count',
'fleet_opened_time',
'fleet_closed_time',
];
}

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Models\Fleets;
use Illuminate\Database\Eloquent\Model;
class AllianceFleetMember extends Model
{
/**
* Table Name
*/
protected $table = 'alliance_fleet_members';
/**
* Timestamps
*/
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'fleet_id',
'character_id',
'character_name',
'fleet_joined_time',
'fleet_leaved_time',
];
}

View File

@@ -0,0 +1,52 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFleetTables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if(!Schema::hasTable('alliance_fleets')) {
Schema::create('alliance_fleets', function(Blueprint $table) {
$table->bigIncrements('id');
$table->bigUnsignedInteger('fleet_id');
$table->bigUnsignedInteger('fleet_commander_id');
$table->string('fleet_commander_name')->nullable();
$table->unsignedInteger('member_count');
$table->dateTime('fleet_opened_time');
$table->dateTime('fleet_closed_time')->nullable();
$table->timestamps();
});
}
if(!Schema::hasTable('alliance_fleet_members')) {
Schema::create('alliance_fleet_members', function(Blueprint $table) {
$table->bigIncrements('id');
$table->bigUnsignedInteger('fleet_id');
$table->bigUnsignedInteger('character_id');
$table->string('character_name');
$table->dateTime('fleet_joined_time');
$table->dateTime('fleet_leaved_time');
$table->timestamps();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('alliance_fleets');
Schema::dropIfExists('alliance_fleet_members');
}
}

View File

@@ -17,6 +17,7 @@ return array(
'App\\Console\\Commands\\MoonMailerCommand' => $baseDir . '/app/Console/Commands/Moons/MoonMailer.php', 'App\\Console\\Commands\\MoonMailerCommand' => $baseDir . '/app/Console/Commands/Moons/MoonMailer.php',
'App\\Console\\Commands\\PurgeUsers' => $baseDir . '/app/Console/Commands/Users/PurgeUsers.php', 'App\\Console\\Commands\\PurgeUsers' => $baseDir . '/app/Console/Commands/Users/PurgeUsers.php',
'App\\Console\\Commands\\PurgeWormholes' => $baseDir . '/app/Console/Commands/Wormholes/PurgeWormholes.php', 'App\\Console\\Commands\\PurgeWormholes' => $baseDir . '/app/Console/Commands/Wormholes/PurgeWormholes.php',
'App\\Console\\Commands\\SovBillsCommand' => $baseDir . '/app/Console/Commands/Finances/SovBills.php',
'App\\Console\\Commands\\UpdateMoonPriceCommand' => $baseDir . '/app/Console/Commands/Moons/UpdateMoonPricing.php', 'App\\Console\\Commands\\UpdateMoonPriceCommand' => $baseDir . '/app/Console/Commands/Moons/UpdateMoonPricing.php',
'App\\Console\\Kernel' => $baseDir . '/app/Console/Kernel.php', 'App\\Console\\Kernel' => $baseDir . '/app/Console/Kernel.php',
'App\\Exceptions\\Handler' => $baseDir . '/app/Exceptions/Handler.php', 'App\\Exceptions\\Handler' => $baseDir . '/app/Exceptions/Handler.php',

View File

@@ -481,6 +481,7 @@ class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9
'App\\Console\\Commands\\MoonMailerCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Moons/MoonMailer.php', 'App\\Console\\Commands\\MoonMailerCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Moons/MoonMailer.php',
'App\\Console\\Commands\\PurgeUsers' => __DIR__ . '/../..' . '/app/Console/Commands/Users/PurgeUsers.php', 'App\\Console\\Commands\\PurgeUsers' => __DIR__ . '/../..' . '/app/Console/Commands/Users/PurgeUsers.php',
'App\\Console\\Commands\\PurgeWormholes' => __DIR__ . '/../..' . '/app/Console/Commands/Wormholes/PurgeWormholes.php', 'App\\Console\\Commands\\PurgeWormholes' => __DIR__ . '/../..' . '/app/Console/Commands/Wormholes/PurgeWormholes.php',
'App\\Console\\Commands\\SovBillsCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Finances/SovBills.php',
'App\\Console\\Commands\\UpdateMoonPriceCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Moons/UpdateMoonPricing.php', 'App\\Console\\Commands\\UpdateMoonPriceCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Moons/UpdateMoonPricing.php',
'App\\Console\\Kernel' => __DIR__ . '/../..' . '/app/Console/Kernel.php', 'App\\Console\\Kernel' => __DIR__ . '/../..' . '/app/Console/Kernel.php',
'App\\Exceptions\\Handler' => __DIR__ . '/../..' . '/app/Exceptions/Handler.php', 'App\\Exceptions\\Handler' => __DIR__ . '/../..' . '/app/Exceptions/Handler.php',