feat: index songs.album_id for PostgreSQL (#1547)

This commit is contained in:
Ibon 2022-10-24 18:01:05 +02:00 committed by GitHub
parent aec70c9a2f
commit 13ffdcc648
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

BIN
composer.phar Normal file

Binary file not shown.

View file

@ -0,0 +1,17 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
Schema::table('songs', static function (Blueprint $table): void {
if (DB::getDriverName() === 'pgsql') {
$table->index('album_id');
}
});
}
};