<?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('joint_accounts', function (Blueprint $table) {
            $table->id();
            $table->string('account_name');
            $table->decimal('balance', 12, 2)->default(0);
            $table->foreignId('primary_owner_id')->constrained('users')->onDelete('cascade');
            $table->string('status')->default('active'); // active, suspended, closed
            $table->timestamps();
        });
    }

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