<?php

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

class CreateRecurringsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recurrings', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('user_id');
            $table->string('subscription_id',20);
            $table->string('transaction_id',20);
            $table->string('recurring_type',100);
            $table->smallInteger('plan_payments');
            $table->double('plan_amount',8,2);
            $table->tinyInteger('day_frequency');
            $table->string('month_frequency',50);
            $table->string('day_of_month',50);
            $table->string('ccnumber',50);
            $table->string('ccexp',20);
            $table->timestamps();
        });
    }

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