Skip to content

Commit

Permalink
Merge pull request #10454 from NiceAesth/laravel-10-migrations
Browse files Browse the repository at this point in the history
Remove `doctrine/dbal` and fix migration improper column types
  • Loading branch information
nanaya authored Aug 16, 2023
2 parents d81acd8 + c19f0a4 commit 5ba12c5
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 389 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"require": {
"anhskohbo/no-captcha": "^3.2",
"chaseconey/laravel-datadog-helper": ">=1.2.0",
"doctrine/dbal": "^3.1",
"egulias/email-validator": "*",
"elasticsearch/elasticsearch": "^7.12.0",
"ezyang/htmlpurifier": "*",
Expand Down
345 changes: 1 addition & 344 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ public function up()
$table->string('image', 50)->nullable()->change();
});

// DBAL, which is used to execute `change()`, doesn't support `mediumInteger`.
DB::statement('ALTER TABLE osu_achievements MODIFY achievement_id MEDIUMINT UNSIGNED NOT NULL');
Schema::table('osu_achievements', function ($table) {
$table->mediumInteger('achievement_id')->unsigned()->change();
});
}

/**
Expand All @@ -47,7 +48,8 @@ public function down()
$table->string('image', 50)->change();
});

// `mediumIncrements` requires unsupported `mediumInteger`.
// Laravel mediumIncrements() always specifies primary key, causing conflicts.

DB::statement('ALTER TABLE osu_achievements MODIFY achievement_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class NullableEntryUrlOnContestEntries extends Migration
public function up()
{
Schema::table('contest_entries', function (Blueprint $table) {
$table->string('entry_url')->nullable()->default('NULL')->change();
$table->string('entry_url')->nullable()->change();
});
}

Expand Down
Loading

0 comments on commit 5ba12c5

Please sign in to comment.