Lae/database/migrations/2022_08_12_082631_create_transcations_table.php
2022-08-13 18:23:34 +08:00

48 lines
1009 B
PHP

<?php
use App\Models\User\Drop;
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()
{
Schema::create('transcations', function (Blueprint $table) {
$table->id();
// remote transaction id
$table->string('remote_id')->index();
// drops id
$table->unsignedBigInteger('drops_id')->index();
$table->foreign('drops_id')->references('id')->on('drops');
// payment
$table->string('payment')->index();
// amount
$table->double('amount', 60, 8)->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transcations');
}
};