관리-도구
편집 파일: 2020_11_13_142034_create_transactions_table.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateTransactionsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('transactions', function (Blueprint $table) { $table->id(); $table->bigInteger('order_id')->unsigned(); $table->string('transaction_id'); $table->string('payment_method',30); $table->decimal('amount',10,2); $table->text('payment_data')->nullable(); $table->timestamps(); $table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('transactions'); } }