diff --git a/app/Library/Structures/StructureHelper.php b/app/Library/Structures/StructureHelper.php index 7b9601977..ae9020eea 100644 --- a/app/Library/Structures/StructureHelper.php +++ b/app/Library/Structures/StructureHelper.php @@ -66,8 +66,6 @@ class StructureHelper { } //Save the database record $struct->save(); - - DB::table('alliance_structures')->insert($struct); /* //If we set the structure services to true, let's save the services diff --git a/app/Models/Structure/Structure.php b/app/Models/Structure/Structure.php index 8559ed050..59bf420bb 100644 --- a/app/Models/Structure/Structure.php +++ b/app/Models/Structure/Structure.php @@ -12,7 +12,7 @@ class Structure extends Model */ //Table Name - public $table = 'alliance_structures'; + public $table = 'AllianceStructures'; //Primary Key public $primaryKey = 'id'; diff --git a/database/migrations/2019_05_29_072409_corporation_assets_table.php b/database/migrations/2019_05_29_072409_corporation_assets_table.php index d664276f7..f23319fdf 100644 --- a/database/migrations/2019_05_29_072409_corporation_assets_table.php +++ b/database/migrations/2019_05_29_072409_corporation_assets_table.php @@ -41,6 +41,34 @@ class CorporationAssetsTable extends Migration }); } + if(!Schema::hasTable('AllianceStructures')) { + Schema::create('AllianceStructures', function(Blueprint $table) { + $table->increments('id'); + $table->string('structure_id')->unique(); + $table->string('structure_name'); + $table->string('solar_system_id'); + $table->string('solar_system_name')->nullable(); + $table->string('type_id'); + $table->string('corporation_id'); + $table->boolean('services'); + $table->string('state'); + $table->dateTime('state_timer_start')->nullable(); + $table->dateTime('state_timer_end')->nullable(); + $table->dateTime('fuel_expires')->nullable(); + $table->string('profile_id'); + $table->string('position_x'); + $table->string('position_y'); + $table->string('position_z'); + $table->dateTime('next_reinforce_apply')->nullable(); + $table->integer('next_reinforce_hour')->nullable(); + $table->integer('next_reinforce_weekday')->nullable(); + $table->integer('reinforce_hour'); + $table->integer('reinforce_weekday')->nullable(); + $table->dateTime('unanchors_at')->nullable(); + $table->timestamps(); + }); + } + if(!Schema::hasTable('alliance_services')) { Schema::create('alliance_services', function(Blueprint $table) { $table->increments('id'); @@ -76,6 +104,7 @@ class CorporationAssetsTable extends Migration public function down() { Schema::dropIfExists('alliance_structures'); + Schema::dropIfExists('AllianceStructures'); Schema::dropIfExists('alliance_services'); Schema::dropIfExists('alliance_assets'); }