<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('friend_calls', function (Blueprint $table) {
            $table->id();
            $table->string('who', 50)->index()->comment('呼叫人');
            $table->string('towho', 50)->index()->comment('被呼叫人');
            $table->text('callmess')->nullable()->comment('呼叫信息');
            $table->dateTime('calltime')->nullable()->index()->comment('呼叫时间');
            $table->tinyInteger('read')->default(0)->comment('是否已读 (1是 0否)');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('friend_calls');
    }
};
