Lae/database/migrations/2022_08_12_082631_create_transcations_table.php

47 lines
932 B
PHP
Raw Normal View History

2022-08-12 07:56:56 +00:00
<?php
2022-08-12 08:51:55 +00:00
use App\Models\User\Drop;
2022-08-12 07:56:56 +00:00
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* 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
$table->foreignIdFor(Drop::class)->index();
// 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
}
};