<?php

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

class CreateUserCardsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_cards', function (Blueprint $table) {
            $table->id();
			$table->foreignId('user_id')->constrained();
			$table->string('card_number')->nullable();
			$table->string('card_name')->nullable();
			$table->string('card_brand')->nullable();
			$table->string('card_brand_logo')->nullable();
			$table->string('card_exp_month')->nullable();
			$table->string('card_exp_year')->nullable();
			$table->string('card_cvc')->nullable();
			$table->string('card_last_four')->nullable();
			$table->string('card_fingerprint')->nullable();
			$table->string('card_funding')->nullable();
			$table->smallInteger('is_default')->default(0);
			$table->smallInteger('is_activated')->default(1);
			$table->smallInteger('is_deleted')->default(0);
            $table->timestamps();
        });
    }

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