increments('id'); // 主键 + AUTO_INCREMENT $table->string('chat_id', 50)->comment('隶属群ID'); $table->string('user_id', 15)->comment('tg的ID'); $table->integer('type')->default(0)->comment('0收入1支出'); $table->dateTime('date')->nullable()->comment('记账时间'); $table->decimal('amount', 12, 2)->default(0)->comment('金额'); $table->dateTime('created_at')->useCurrent()->nullable(); $table->dateTime('updated_at')->nullable()->useCurrentOnUpdate(); $table->charset = 'utf8mb4'; $table->collation = 'utf8mb4_0900_ai_ci'; $table->comment('收支记录'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('ledger'); } };