-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update EGAA Positions Fix top-down order. Add AA INT as top down for EGAC. * Change EGCC Ownership To MAN_W The documents lied. * Add Wallasey Sector Top-down for CC and GP over MAN_W * Add REDFA and SABER splits for TC East * Update Scottish TMA Frequencies * Add EGPC and EGPA, Add EGPB APP To Top Down * Add Scottish North Sector * Add Scottish South Sector * Add Scottish Central Sector No top down. * Update Gatwick Non-RNAV Departures Update the identifiers. * Update Cambridge Squawk Ranges * Remove Duplicate EGPB Key
- Loading branch information
Showing
4 changed files
with
205 additions
and
12 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
database/migrations/2019_09_14_094017_update_gatwick_departures.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
use App\Models\Airfield; | ||
use App\Models\Sid; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class UpdateGatwickDepartures extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
$gatwick = Airfield::where('code', 'EGKK')->firstOrFail()->id; | ||
|
||
$sids = [ | ||
'LAM5M' => 'LAM6M', | ||
'LAM5V' => 'LAM6V', | ||
'CLN9M' => 'CLN1M', | ||
'CLN9V' => 'CLN1V', | ||
'DVR9M' => 'DVR1M', | ||
'DVR9V' => 'DVR1V', | ||
]; | ||
|
||
foreach ($sids as $old => $new) { | ||
$this->updateSid($gatwick, $old, $new); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
$gatwick = Airfield::where('code', 'EGKK')->firstOrFail()->id; | ||
|
||
$sids = [ | ||
'LAM6M' => 'LAM5M', | ||
'LAM6V' => 'LAM5V', | ||
'CLN1M' => 'CLN9M', | ||
'CLN1V' => 'CLN9V', | ||
'DVR1M' => 'DVR9M', | ||
'DVR1V' => 'DVR9V', | ||
]; | ||
|
||
foreach ($sids as $old => $new) { | ||
$this->updateSid($gatwick, $old, $new); | ||
} | ||
} | ||
|
||
private function updateSid(int $gatwickAirfieldId, string $oldIdentifier, string $newIdentifier) : void | ||
{ | ||
Sid::where('airfield_id', $gatwickAirfieldId) | ||
->where('identifier', $oldIdentifier) | ||
->update(['identifier' => $newIdentifier]); | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
database/migrations/2019_09_14_094914_update_cambridge_squawk_range.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
use App\Models\Squawks\Range; | ||
use App\Models\Squawks\SquawkUnit; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class UpdateCambridgeSquawkRange extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
$cambridge = SquawkUnit::where('unit', 'EGSC')->firstOrFail(); | ||
|
||
// Delete the old ranges | ||
$cambridge->ranges->each(function (Range $range) { | ||
$range->delete(); | ||
}); | ||
|
||
// Add new ranges | ||
|
||
Range::create( | ||
[ | ||
'squawk_range_owner_id' => $cambridge->rangeOwner->id, | ||
'start' => '6160', | ||
'stop' => '6175', | ||
'rules' => 'A', | ||
'allow_duplicate' => false, | ||
] | ||
); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
$cambridge = SquawkUnit::where('unit', 'EGSC')->firstOrFail(); | ||
|
||
// Delete the old ranges | ||
$cambridge->ranges->each(function (Range $range) { | ||
$range->delete(); | ||
}); | ||
|
||
// Add new ranges | ||
Range::insert( | ||
[ | ||
[ | ||
'squawk_range_owner_id' => $cambridge->rangeOwner->id, | ||
'start' => '6160', | ||
'stop' => '6176', | ||
'rules' => 'A', | ||
'allow_duplicate' => false, | ||
], | ||
[ | ||
'squawk_range_owner_id' => $cambridge->rangeOwner->id, | ||
'start' => '6171', | ||
'stop' => '6177', | ||
'rules' => 'A', | ||
'allow_duplicate' => false, | ||
], | ||
] | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters