<?php


/**
 * Author: Emmanuel Paul Mnzava
 * Twitter: @epmnzava
 * Github:https://github.com/dbrax/bill-me
 * Email: epmnzava@gmail.com
 * 
 */

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

class CreateBillingPaymentTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('billing_payments', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('userid')->nullable();
            $table->string('invoiceid')->nullable(); 
            $table->string('orderid'); 
            $table->string('status')->default('pending'); 
            $table->string('trackingid')->nullable(); 
            $table->string('receipt')->nullable();
            $table->string('referenceid')->nullable();
            $table->bigInteger("amount")->nullable();
            $table->bigInteger("balance_before_payment")->nullable();
            $table->bigInteger("balance_after_payment")->nullable();
            $table->bigInteger("msisdn")->nullable();
            $table->date("date");
            $table->string('payment_method')->nullable();
            $table->timestamps();
        });
    }

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