@@ -11,7 +11,7 @@ if (!function_exists('createFactoryICAO')) {
|
||||
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$max = strlen($characters) - 1;
|
||||
$string = '';
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
try {
|
||||
$string .= $characters[random_int(0, $max)];
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Increase Airport ICAO size to 5 chars
|
||||
* https://github.com/nabeelio/phpvms/issues/1052
|
||||
*/
|
||||
class IncreaseIcaoSizes extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('airports', function (Blueprint $table) {
|
||||
$table->string('iata', 5)->change();
|
||||
$table->string('icao', 5)->change();
|
||||
});
|
||||
|
||||
Schema::table('pireps', function (Blueprint $table) {
|
||||
$table->string('dpt_airport_id', 5)->change();
|
||||
$table->string('arr_airport_id', 5)->change();
|
||||
$table->string('alt_airport_id', 5)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user