refactor: 将广播事件改为异步队列并增强索引检查兼容性

This commit is contained in:
2026-06-10 13:58:16 +08:00
parent 1948b10fe6
commit c887c4e146
11 changed files with 134 additions and 27 deletions

View File

@@ -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);
}
};