<?php

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

class CreateSiteUrlShortenerMappingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('site_url_shortener_mappings', function (Blueprint $table) {
            $table->id();
            $table->string('action_type')->nullable();
            $table->string('url');
            $table->string('short_code')->unique();
            $table->text('encoded_string');
            $table->string('route');
            $table->text('query_param');
            $table->timestamps();
        });
    }

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