From 37850267497a2a34de1cc083aa860cc3360fed8d Mon Sep 17 00:00:00 2001 From: terrylee Date: Mon, 29 Jun 2026 14:33:43 +0800 Subject: [PATCH] =?UTF-8?q?chore(db):=20=E8=A3=9C=E4=B8=8A=20cache=20/=20c?= =?UTF-8?q?ache=5Flocks=20=E8=A1=A8=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dev 的修正 55cf6b8 將 CACHE_STORE 正確解析為 database,但 repo 未含 cache 表 migration。補上標準 Laravel cache 表(含 hasTable 防呆),確保各環境 pull 後 database 快取可用,避免 ProcessHeartbeat 的 Cache::put 因缺表崩潰。 Co-Authored-By: Claude Opus 4.8 (1M context) --- .../2026_06_26_130000_create_cache_table.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 database/migrations/2026_06_26_130000_create_cache_table.php diff --git a/database/migrations/2026_06_26_130000_create_cache_table.php b/database/migrations/2026_06_26_130000_create_cache_table.php new file mode 100644 index 0000000..45aa5d9 --- /dev/null +++ b/database/migrations/2026_06_26_130000_create_cache_table.php @@ -0,0 +1,38 @@ +string('key')->primary(); + $table->mediumText('value'); + $table->integer('expiration'); + }); + } + + if (!Schema::hasTable('cache_locks')) { + Schema::create('cache_locks', function (Blueprint $table) { + $table->string('key')->primary(); + $table->string('owner'); + $table->integer('expiration'); + }); + } + } + + public function down(): void + { + Schema::dropIfExists('cache'); + Schema::dropIfExists('cache_locks'); + } +};