fix(link-tracker): prefix index on target_url for MySQL 5.7 compat
This commit is contained in:
+3
-1
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
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
|
||||
@@ -24,7 +25,8 @@ return new class extends Migration
|
||||
$table->timestamp('last_clicked_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('target_url');
|
||||
// MySQL 5.7 不支持对 TEXT 建全值索引,用前缀索引
|
||||
$table->index([DB::raw('target_url(191)')], 'redirects_target_url_index');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user