<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('billing_data', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->string('country')->nullable();
            $table->string('currency')->nullable();
            $table->enum('object',['card','bank_account']);
            $table->string('last4');
            $table->string('stripe_id');
            $table->string('stripe_account');
            $table->enum('account_holder_type',['individual','company'])->nullable();
            $table->string('account_holder_name')->nullable();
            $table->integer('exp_month')->nullable();
            $table->integer('exp_year')->nullable();
            $table->string('brand')->nullable();
            $table->string('owner_type');
            $table->unsignedBigInteger('owner_id');
            $table->softDeletes();
        });
    }

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