Skip to content

Commit 57c53b5

Browse files
committed
fix: Add missing migrations
1 parent 8d0bdcd commit 57c53b5

File tree

5 files changed

+212
-0
lines changed

5 files changed

+212
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
namespace App\Models\SC\Vehicle;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
use Illuminate\Database\Eloquent\Relations\BelongsTo;
7+
8+
class VehicleCargoGrid extends Model
9+
{
10+
protected $table = 'sc_vehicle_cargo_grids';
11+
12+
protected $fillable = [
13+
'vehicle_id',
14+
'container_uuid',
15+
'capacity',
16+
'unit_name',
17+
'x',
18+
'y',
19+
'z',
20+
'min_x',
21+
'min_y',
22+
'min_z',
23+
'max_x',
24+
'max_y',
25+
'max_z',
26+
'is_open',
27+
'is_external',
28+
'is_closed',
29+
];
30+
31+
protected $casts = [
32+
'capacity' => 'double',
33+
'x' => 'double',
34+
'y' => 'double',
35+
'z' => 'double',
36+
'min_x' => 'double',
37+
'min_y' => 'double',
38+
'min_z' => 'double',
39+
'max_x' => 'double',
40+
'max_y' => 'double',
41+
'max_z' => 'double',
42+
'is_open' => 'bool',
43+
'is_external' => 'bool',
44+
'is_closed' => 'bool',
45+
];
46+
47+
public function vehicle(): BelongsTo
48+
{
49+
return $this->belongsTo(Vehicle::class, 'vehicle_id', 'id');
50+
}
51+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('sc_vehicle_cargo_grids', static function (Blueprint $table) {
15+
$table->id();
16+
$table->unsignedBigInteger('vehicle_id');
17+
$table->uuid('container_uuid');
18+
$table->unsignedInteger('capacity');
19+
$table->text('unit_name');
20+
21+
$table->unsignedDouble('x')->nullable();
22+
$table->unsignedDouble('y')->nullable();
23+
$table->unsignedDouble('z')->nullable();
24+
25+
$table->unsignedDouble('min_x')->nullable();
26+
$table->unsignedDouble('min_y')->nullable();
27+
$table->unsignedDouble('min_z')->nullable();
28+
29+
$table->unsignedDouble('max_x')->nullable();
30+
$table->unsignedDouble('max_y')->nullable();
31+
$table->unsignedDouble('max_z')->nullable();
32+
33+
$table->boolean('is_open')->default(false);
34+
$table->boolean('is_external')->default(false);
35+
$table->boolean('is_closed')->default(false);
36+
$table->timestamps();
37+
});
38+
}
39+
40+
/**
41+
* Reverse the migrations.
42+
*/
43+
public function down(): void
44+
{
45+
Schema::dropIfExists('sc_vehicle_cargo_grids');
46+
}
47+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('sc_vehicles', static function (Blueprint $table) {
15+
$table->unsignedDouble('cargo_capacity')->nullable()->after('mass');
16+
});
17+
}
18+
19+
/**
20+
* Reverse the migrations.
21+
*/
22+
public function down(): void
23+
{
24+
Schema::table('sc_vehicles', static function (Blueprint $table) {
25+
$table->dropColumn('cargo_capacity');
26+
});
27+
}
28+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('sc_item_flight_controllers', static function (Blueprint $table) {
15+
$table->unsignedDouble('scm_boost_forward')->nullable()->after('scm_speed');
16+
$table->unsignedDouble('scm_boost_backward')->nullable()->after('scm_boost_forward');
17+
18+
$table->unsignedDouble('pitch_boost_multiplier')->nullable()->after('roll');
19+
$table->unsignedDouble('roll_boost_multiplier')->nullable()->after('pitch_boost_multiplier');
20+
$table->unsignedDouble('yaw_boost_multiplier')->nullable()->after('roll_boost_multiplier');
21+
22+
$table->unsignedDouble('afterburner_capacitor')->nullable()->after('yaw_boost_multiplier');
23+
$table->unsignedDouble('afterburner_idle_cost')->nullable()->after('afterburner_capacitor');
24+
$table->unsignedDouble('afterburner_linear_cost')->nullable()->after('afterburner_idle_cost');
25+
$table->unsignedDouble('afterburner_angular_cost')->nullable()->after('afterburner_linear_cost');
26+
$table->unsignedDouble('afterburner_regen_per_sec')->nullable()->after('afterburner_angular_cost');
27+
$table->unsignedDouble('afterburner_regen_delay_after_use')->nullable()->after('afterburner_regen_per_sec');
28+
29+
$table->unsignedDouble('afterburner_pre_delay_time')->nullable()->after('afterburner_regen_delay_after_use');
30+
$table->unsignedDouble('afterburner_ramp_up_time')->nullable()->after('afterburner_pre_delay_time');
31+
$table->unsignedDouble('afterburner_ramp_down_time')->nullable()->after('afterburner_ramp_up_time');
32+
});
33+
}
34+
35+
/**
36+
* Reverse the migrations.
37+
*/
38+
public function down(): void
39+
{
40+
Schema::table('sc_item_flight_controllers', static function (Blueprint $table) {
41+
$table->dropColumn('scm_boost_forward');
42+
$table->dropColumn('scm_boost_backward');
43+
$table->dropColumn('pitch_boost_multiplier');
44+
$table->dropColumn('roll_boost_multiplier');
45+
$table->dropColumn('yaw_boost_multiplier');
46+
$table->dropColumn('afterburner_capacitor');
47+
$table->dropColumn('afterburner_idle_cost');
48+
$table->dropColumn('afterburner_linear_cost');
49+
$table->dropColumn('afterburner_angular_cost');
50+
$table->dropColumn('afterburner_regen_per_sec');
51+
$table->dropColumn('afterburner_regen_delay_after_use');
52+
$table->dropColumn('afterburner_pre_delay_time');
53+
$table->dropColumn('afterburner_ramp_up_time');
54+
$table->dropColumn('afterburner_ramp_down_time');
55+
});
56+
}
57+
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('sc_vehicles', static function (Blueprint $table) {
15+
// This ideally belongs to the shield controller
16+
$table->string('shield_face_type')->nullable()->after('expedite_cost');
17+
});
18+
}
19+
20+
/**
21+
* Reverse the migrations.
22+
*/
23+
public function down(): void
24+
{
25+
Schema::table('sc_vehicles', static function (Blueprint $table) {
26+
$table->dropColumn('shield_face_type');
27+
});
28+
}
29+
};

0 commit comments

Comments
 (0)