<?php

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

class CreateSiteRespondIoEventLogMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('site_respond_io_event_log_messages', function (Blueprint $table) {
            $table->id();
            $table->foreignId('event_log_id')->constrained('site_respond_io_event_logs');
            $table->bigInteger('message_id');
            $table->bigInteger('channel_message_id');
            $table->bigInteger('contact_id');
            $table->bigInteger('channel_id');
            $table->string('traffic');
            $table->json('message');
            $table->bigInteger('timestamp');
            $table->json('status');
            $table->json('variables')->nullable();
            $table->timestamps();
        });
    }

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