Migration Fix
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
DB::table('airlines')->insert([
|
||||
'IATA_code' => 'TZ',
|
||||
'ICAO_code' => 'TDS',
|
||||
'name' => 'Tsaradia',
|
||||
'internal_name' => 'tsaradia',
|
||||
'country_code' => 'MG',
|
||||
'country_name' => 'Madagascar',
|
||||
'active' => false,
|
||||
'logo' => 'TZ.png',
|
||||
]);
|
||||
|
||||
DB::table('airlines')
|
||||
->where('IATA_code', 'TZ')
|
||||
->where('internal_name', 'scoot-private')
|
||||
->update([
|
||||
'active' => false,
|
||||
'logo' => 'TR.png',
|
||||
'name' => 'Scoot'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
DB::table('airlines')->where('internal_name', 'tsaradia')->delete();
|
||||
DB::table('airlines')
|
||||
->where('IATA_code', 'TZ')
|
||||
->where('internal_name', 'scoot-private')
|
||||
->update([
|
||||
'active' => true,
|
||||
'logo' => 'TZ.png',
|
||||
'name' => 'Scoot Private Limited'
|
||||
]);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user