From 7c33259a3389fe7881916a31ffe4d4453959ff7d Mon Sep 17 00:00:00 2001 From: Abdullahi Abdul Kabir Date: Thu, 17 Oct 2024 16:53:45 +0100 Subject: [PATCH 1/2] laravel 11 floating-point types --- database/migrations/2017_01_01_112200_create_files_table.php | 2 +- .../migrations/2017_01_01_112400_create_uploads_table.php | 2 +- .../2017_01_01_112600_create_favorite_files_table.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database/migrations/2017_01_01_112200_create_files_table.php b/database/migrations/2017_01_01_112200_create_files_table.php index 45466e4..39b1926 100644 --- a/database/migrations/2017_01_01_112200_create_files_table.php +++ b/database/migrations/2017_01_01_112200_create_files_table.php @@ -11,7 +11,7 @@ public function up() Schema::create('files', function (Blueprint $table) { $table->id(); - $table->unsignedBigInteger('type_id'); + $table->bigInteger('type_id')->unsigned(); $table->foreign('type_id')->references('id')->on('file_types'); $table->nullableMorphs('attachable'); diff --git a/database/migrations/2017_01_01_112400_create_uploads_table.php b/database/migrations/2017_01_01_112400_create_uploads_table.php index 7f4078b..0063b33 100644 --- a/database/migrations/2017_01_01_112400_create_uploads_table.php +++ b/database/migrations/2017_01_01_112400_create_uploads_table.php @@ -11,7 +11,7 @@ public function up() Schema::create('uploads', function (Blueprint $table) { $table->increments('id'); - $table->unsignedBigInteger('file_id')->nullable()->unique(); + $table->bigInteger('file_id')->unsigned()->nullable()->unique(); $table->foreign('file_id')->references('id')->on('files') ->onUpdate('restrict')->onDelete('restrict'); diff --git a/database/migrations/2017_01_01_112600_create_favorite_files_table.php b/database/migrations/2017_01_01_112600_create_favorite_files_table.php index 2cd6688..6395d41 100644 --- a/database/migrations/2017_01_01_112600_create_favorite_files_table.php +++ b/database/migrations/2017_01_01_112600_create_favorite_files_table.php @@ -11,10 +11,10 @@ public function up() Schema::create('favorite_files', function (Blueprint $table) { $table->id(); - $table->unsignedInteger('user_id')->index(); + $table->integer('user_id')->unsigned()->index(); $table->foreign('user_id')->references('id')->on('users'); - $table->unsignedBigInteger('file_id')->index(); + $table->bigInteger('file_id')->unsigned()->index(); $table->foreign('file_id')->references('id')->on('files') ->onUpdate('restrict')->onDelete('restrict'); From 36e7a48aa3d1a5a2496bc1893d6244960fa0fc5c Mon Sep 17 00:00:00 2001 From: Abdullahi Abdul Kabir Date: Thu, 17 Oct 2024 17:00:47 +0100 Subject: [PATCH 2/2] laravel 11 floating-point types --- tests/features/FileTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/features/FileTest.php b/tests/features/FileTest.php index 8f90a62..d93e3e5 100644 --- a/tests/features/FileTest.php +++ b/tests/features/FileTest.php @@ -126,7 +126,7 @@ private function createTestTable(): self Schema::create('attachable_models', function ($table) { $table->increments('id'); - $table->unsignedBigInteger('file_id')->nullable(); + $table->bigInteger('file_id')->unsigned()->nullable(); $table->foreign('file_id')->references('id')->on('files') ->onUpdate('restrict')->onDelete('restrict');