<?php

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('trades', function (Blueprint $table) {
            $table->id();
            $table->foreignId('trader_id');
            $table->string('trade_type');
            $table->string('status');
            $table->string('open_time');
            $table->string('close_time');
            $table->decimal('open_price', 20, 5);
            $table->decimal('close_price', 20, 5);
            $table->string('order_id');
            $table->timestamps();
            $table->decimal('commission', 20, 2);

        });
    }

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