<?php

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

class PhotoAddIndex extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('photo', function (Blueprint $table) {
            $table->index(['signature']);
            $table->index(['filename']);
            $table->index(['remove']);
            $table->index(['duplicate']);
            $table->index(['date_created','subsectime','model','make']);
        });
        Schema::table('videos', function (Blueprint $table) {
            $table->index(['signature']);
            $table->index(['filename']);
            $table->index(['remove']);
            $table->index(['duplicate']);
            $table->index(['date_created','model','make']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('photo', function (Blueprint $table) {
            $table->dropIndex(['signature']);
            $table->dropIndex(['filename']);
            $table->dropIndex(['remove']);
            $table->dropIndex(['duplicate']);
            $table->dropIndex(['date_created','subsectime','model','make']);
        });
        Schema::table('videos', function (Blueprint $table) {
            $table->dropIndex(['signature']);
            $table->dropIndex(['filename']);
            $table->dropIndex(['remove']);
            $table->dropIndex(['duplicate']);
            $table->dropIndex(['date_created','model','make']);
        });
    }
}