<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('deleted_payments', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('cover_id');
            $table->integer('payment_method');
            $table->float('cash_tendered');
            $table->string('months');
            $table->float('change');
            $table->unsignedBigInteger('member_id');
            $table->date('payment_date');
            $table->unsignedBigInteger('user_id');
            $table->float('amount_paid');
            $table->integer('submission_status')->default(0);
            $table->boolean('satus')->default(0);
            $table->boolean('cash')->default(0);
            $table->unsignedBigInteger('deleted_by');
            $table->timestamp('deleted_at');
            $table->timestamps();
            $table->foreign('member_id')->references('id')->on('members')->onDelete('cascade');
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            $table->foreign('deleted_by')->references('id')->on('users')->onDelete('cascade');       
        });
    }

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