Lae/database/migrations/2022_08_12_082631_create_transcations_table.php

46 lines
983 B
PHP
Raw Normal View History

2022-08-12 07:56:56 +00:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
2022-08-12 07:56:56 +00:00
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
2022-08-12 08:51:55 +00:00
Schema::create('transcations', function (Blueprint $table) {
2022-08-12 07:56:56 +00:00
$table->id();
2022-08-12 08:51:55 +00:00
// remote transaction id
$table->string('remote_id')->index();
// drops id
2022-08-13 10:23:34 +00:00
$table->unsignedBigInteger('drops_id')->index();
$table->foreign('drops_id')->references('id')->on('drops');
2022-08-12 08:51:55 +00:00
// payment
$table->string('payment')->index();
// amount
2022-08-13 09:47:10 +00:00
$table->double('amount', 60, 8)->default(0);
2022-08-12 08:51:55 +00:00
2022-08-12 07:56:56 +00:00
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
2022-08-12 08:51:55 +00:00
Schema::dropIfExists('transcations');
2022-08-12 07:56:56 +00:00
}
};