Просмотр исходного кода

lhc_order / lhc_order_item.member_id 改为 bigint,修复 TG 用户 ID 溢出

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
doge 7 часов назад
Родитель
Сommit
32ca651899
1 измененных файлов с 27 добавлено и 0 удалено
  1. 27 0
      database/migrations/2026_11_05_170000_widen_lhc_order_member_id.php

+ 27 - 0
database/migrations/2026_11_05_170000_widen_lhc_order_member_id.php

@@ -0,0 +1,27 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+// Telegram 用户 ID 超过 int(11) 上限(如 6726782956),机器人下注写入 lhc_order / lhc_order_item 时溢出。
+return new class extends Migration
+{
+    public function up(): void
+    {
+        foreach (['lhc_order', 'lhc_order_item'] as $table) {
+            Schema::table($table, function (Blueprint $t) {
+                $t->unsignedBigInteger('member_id')->nullable()->comment('用户id')->change();
+            });
+        }
+    }
+
+    public function down(): void
+    {
+        foreach (['lhc_order', 'lhc_order_item'] as $table) {
+            Schema::table($table, function (Blueprint $t) {
+                $t->integer('member_id')->nullable()->comment('用户id')->change();
+            });
+        }
+    }
+};