Skip to content

Commit

Permalink
Merge pull request #46 from laravel-enso/upgrade/larave11MigrationChange
Browse files Browse the repository at this point in the history
laravel 11 floating-point types
  • Loading branch information
GITmanuela authored Oct 18, 2024
2 parents 854ff2a + 36e7a48 commit eba1ac9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion tests/features/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit eba1ac9

Please sign in to comment.