<?php

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

class AlterEncryptedColumnsToText extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $driver = Schema::connection($this->getConnection())->getConnection()->getDriverName();

        if ('sqlite' !== $driver) {
            
            Schema::table('twofaccounts', function (Blueprint $table) {
                $table->text('account')->nullable()->change();
            });

            Schema::table('twofaccounts', function (Blueprint $table) {
                $table->text('uri')->change();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('twofaccounts', function (Blueprint $table) {
            //
        });
    }
}
