<?php

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

class CreatePaymentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('acc_payments', function (Blueprint $table) {
            $table->id();
            $table->date('pv_date')->nullable();
            $table->date('pv_ref_date')->nullable();
            $table->integer('pv_id')->nullable();
            $table->string('req_id')->nullable();
            $table->string('acc_id', 10)->nullable();
            $table->string('type', 100)->nullable();
            $table->string('ledger_id', 10)->nullable();
            $table->string('dr_id', 10)->nullable();
            $table->string('branch', 10)->nullable();
            $table->string('mode', 10)->nullable();
            $table->string('sub_mode', 10)->nullable();
            $table->string('ref', 255)->nullable();
            $table->longText('nar')->nullable();
            $table->string('amount', 100)->nullable();
            $table->string('currency', 10)->nullable();
            $table->string('conversion_rate', 100)->nullable();
            $table->string('stamp', 30)->nullable();
            $table->string('reversal_reason', 255)->nullable();
            $table->string('reversed_by', 10)->nullable();
            $table->date('reversed_at')->nullable();
            $table->string('pv_status', 50)->nullable();
            $table->string('created_by', 10)->nullable();
            $table->string('deleted_by', 10)->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

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