Skip to content

Commit

Permalink
fix: Fixed failing tests because of collation changes (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maniload authored Sep 10, 2024
1 parent 3ce94d9 commit 2e0e411
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ public function up(): void
$table->id(Playlist::ATTRIBUTE_ID);
$table->timestamps(6);
$table->softDeletes(BaseModel::ATTRIBUTE_DELETED_AT, 6);
$table->string(HasHashids::ATTRIBUTE_HASHID)->nullable()->collation('utf8mb4_bin');
$hashIdColumn = $table->string(HasHashids::ATTRIBUTE_HASHID)->nullable();
if (DB::connection() instanceof MySqlConnection) {
// Set collation to binary to be case-sensitive
$hashIdColumn->collation('utf8mb4_bin');
}
$table->string(Playlist::ATTRIBUTE_NAME);
$table->integer(Playlist::ATTRIBUTE_VISIBILITY);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ public function up(): void
$table->id(PlaylistTrack::ATTRIBUTE_ID);
$table->timestamps(6);
$table->softDeletes(BaseModel::ATTRIBUTE_DELETED_AT, 6);
$table->string(HasHashids::ATTRIBUTE_HASHID)->nullable()->collation('utf8mb4_bin');
$hashIdColumn = $table->string(HasHashids::ATTRIBUTE_HASHID)->nullable();
if (DB::connection() instanceof MySqlConnection) {
// Set collation to binary to be case-sensitive
$hashIdColumn->collation('utf8mb4_bin');
}

$table->unsignedBigInteger(PlaylistTrack::ATTRIBUTE_PLAYLIST);
$table->foreign(PlaylistTrack::ATTRIBUTE_PLAYLIST)->references(Playlist::ATTRIBUTE_ID)->on(Playlist::TABLE)->cascadeOnDelete();
Expand Down

0 comments on commit 2e0e411

Please sign in to comment.