refactor: 将广播事件改为异步队列并增强索引检查兼容性
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
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
|
||||
@@ -39,10 +38,7 @@ return new class extends Migration
|
||||
|
||||
private function hasIndex(string $table, string $indexName): bool
|
||||
{
|
||||
return DB::table('pg_indexes')
|
||||
->where('schemaname', 'public')
|
||||
->where('tablename', $table)
|
||||
->where('indexname', $indexName)
|
||||
->exists();
|
||||
// 使用 Laravel 内置方法,兼容 PostgreSQL 和 SQLite 测试环境
|
||||
return Schema::hasIndex($table, $indexName);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user