From 8dcc9702dc2613e384e09c11bca8da7b20e92ebd Mon Sep 17 00:00:00 2001 From: Taylor Broad Date: Sat, 7 Dec 2024 04:33:02 +0900 Subject: [PATCH] Add Sources to ACARS Entries (#1905) * Add Sources to ACARS Entries * Made changes based on feedback from Dispo * Updated AcarsController to add API route to show supported sources and their ID * Style fixes * One more fix * Fixes based on suggestions by nabeel. * Rollback file * Revert Changes * Delete app/Models/AcarsSource.php * fix charset * StyleCI fix * switch colaltion to charset --- ...2_03_093851_add_sources_to_acars_table.php | 27 +++++++++++++++++++ app/Http/Controllers/Api/AcarsController.php | 4 +-- app/Models/Acars.php | 1 + 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 app/Database/migrations/2024_12_03_093851_add_sources_to_acars_table.php diff --git a/app/Database/migrations/2024_12_03_093851_add_sources_to_acars_table.php b/app/Database/migrations/2024_12_03_093851_add_sources_to_acars_table.php new file mode 100644 index 000000000..9a25d4ec3 --- /dev/null +++ b/app/Database/migrations/2024_12_03_093851_add_sources_to_acars_table.php @@ -0,0 +1,27 @@ +string('source', 5)->charset('latin1')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('acars', function (Blueprint $table) { + $table->dropColumn('source'); + }); + } +}; diff --git a/app/Http/Controllers/Api/AcarsController.php b/app/Http/Controllers/Api/AcarsController.php index d8b5f4e02..d430de562 100644 --- a/app/Http/Controllers/Api/AcarsController.php +++ b/app/Http/Controllers/Api/AcarsController.php @@ -277,7 +277,7 @@ public function acars_logs(string $id, LogRequest $request): JsonResponse $count++; } catch (QueryException $ex) { - Log::info('Error on adding ACARS position: '.$ex->getMessage()); + Log::info('Error on adding ACARS log: '.$ex->getMessage()); } } @@ -336,7 +336,7 @@ public function acars_events(string $id, EventRequest $request): JsonResponse $count++; } catch (QueryException $ex) { - Log::info('Error on adding ACARS position: '.$ex->getMessage()); + Log::info('Error on adding ACARS event: '.$ex->getMessage()); } } diff --git a/app/Models/Acars.php b/app/Models/Acars.php index 804878996..54c3dd7ba 100644 --- a/app/Models/Acars.php +++ b/app/Models/Acars.php @@ -57,6 +57,7 @@ class Acars extends Model 'autopilot', 'fuel_flow', 'sim_time', + 'source', 'created_at', 'updated_at', ];