Files
lelong/database/migrations/2022_01_25_010223_create_payment_table.php
T
2022-01-25 14:05:14 +08:00

78 lines
2.5 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePaymentTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('payment', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->unsignedBigInteger('lelongbidder_id')->unsigned()->nullable();
$table->unsignedBigInteger('lelongbid_id')->unsigned();
$table->string('kodcaw')->nullable();
$table->decimal('total_payment')->nullable();
$table->string('back_acc_pembeli')->nullable();
$table->string('bank_acc_no_pembeli')->nullable();
$table->string('nama_bank_acc_caw')->nullable();
$table->string('bank_no_acc_caw')->nullable();
$table->integer('status_payment_opt')->nullable();
$table->integer('resit_id');
$table->integer('status'); //1 = fee RM10 , 2 = paybidifwin
$table->string('remark');
$table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->foreign('lelongbid_id')
->references('id')->on('lelongbid')
->onDelete('cascade');
$table->foreign('lelongbidder_id')
->references('id')->on('lelongbidder')
->onDelete('cascade');
});
Schema::create('resit', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->unsignedBigInteger('lelongbid_id')->unsigned()->nullable();
$table->string('reference_no')->nullable();
$table->integer('billplz_id');
$table->string('total_payment');
$table->string('resit_type');
$table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->foreign('lelongbid_id')
->references('id')->on('lelongbid')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('payment');
Schema::dropIfExists('resit');
}
}