<?php

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

class CreateRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::connection('mysql2')->create('records', function (Blueprint $table) {
            $table->id();
            $table->timestamp('calldate');
            $table->unsignedBigInteger('src');
            $table->unsignedBigInteger('dst');
            $table->unsignedBigInteger('duration');
            $table->string('recordfile');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::connection('mysql2')->dropIfExists('records');
    }
}
