<?php

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

class RenameSubscriptionOptionsTable extends Migration
{
    private $current_table_name = 'subscription_options';
    private $new_table_name = 'subscription_preferences';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable($this->new_table_name)) {
            Schema::rename($this->current_table_name, $this->new_table_name);
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::rename($this->new_table_name, $this->current_table_name);
    }
}


