<?php

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

class DeprecatedTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        try {
            DB::beginTransaction();
            Schema::dropIfExists('goliath_appliance_rollbacks');
            Schema::dropIfExists('goliath_appliance_capture');
            Schema::dropIfExists('mercury_gre_routes');
            Schema::dropIfExists('mercury_gre');
            Schema::dropIfExists('mercury_appliances');
            Schema::dropIfExists('mercury_nodes');
            Schema::dropIfExists('modules');
            Schema::dropIfExists('goliath_snapshots');
            DB::commit();
        }
        catch(Throwable $t) {
            \Log::debug($t);
            DB::rollBack();
        }

    }

    public function down()
    {
        // Irrelevant, we don't really go "back" with Creatia when it comes to these things, we'd just low a backup.
    }
}
