From 1570ca9f8f85805956284b9d191543cb49588a84 Mon Sep 17 00:00:00 2001 From: 0x1DEA Date: Tue, 26 Dec 2023 21:06:10 -0600 Subject: [PATCH] 2.2 Platformer length fix --- app/Actions/Hydrate.php | 1 + app/Doctrine/TinyInteger.php | 54 +++++++++++++++++++ config/database.php | 19 +++++++ .../2023_12_27_021144_change_levels_22.php | 31 +++++++++++ 4 files changed, 105 insertions(+) create mode 100644 app/Doctrine/TinyInteger.php create mode 100644 database/migrations/tenant/0.4.0/2023_12_27_021144_change_levels_22.php diff --git a/app/Actions/Hydrate.php b/app/Actions/Hydrate.php index 72013c1..ed8b36f 100644 --- a/app/Actions/Hydrate.php +++ b/app/Actions/Hydrate.php @@ -46,6 +46,7 @@ public static function level(int $id, bool $abort = true): ?Level ]; $lengths = [ + 'plat' => -1, 'tiny' => 0, 'short' => 1, 'medium' => 2, diff --git a/app/Doctrine/TinyInteger.php b/app/Doctrine/TinyInteger.php new file mode 100644 index 0000000..d622b6c --- /dev/null +++ b/app/Doctrine/TinyInteger.php @@ -0,0 +1,54 @@ + env('DB_CONNECTION', 'mysql'), + /* + |-------------------------------------------------------------------------- + | Fucking Hell + |-------------------------------------------------------------------------- + | + | There is no god + | + | https://github.com/laravel/framework/issues/8840 + | + */ + + 'dbal' => [ + 'types' => [ + TinyInteger::NAME => TinyInteger::class, + ], + ], + + /* |-------------------------------------------------------------------------- | Database Connections diff --git a/database/migrations/tenant/0.4.0/2023_12_27_021144_change_levels_22.php b/database/migrations/tenant/0.4.0/2023_12_27_021144_change_levels_22.php new file mode 100644 index 0000000..a6cbc14 --- /dev/null +++ b/database/migrations/tenant/0.4.0/2023_12_27_021144_change_levels_22.php @@ -0,0 +1,31 @@ +tinyInteger('length')->nullable()->change(); + $table->tinyInteger('epic')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('levels', function (Blueprint $table) { + $table->unsignedTinyInteger('length')->nullable()->change(); + $table->boolean('epic')->nullable()->change(); + }); + } +};