Edit File: 2023_11_13_011404_create_wallet_transactions_table.php
<?php use Illuminate\Database\Eloquent\Relations\MorphMany; 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('wallet_transactions', function (Blueprint $table) { $table->id(); $table -> unsignedBigInteger( 'wallet_id' ) -> unsigned() -> index(); $table -> foreign( 'wallet_id' ) -> references( 'id' ) -> on( 'wallets' )-> onDelete( 'cascade' ); $table->integer('type')->default(0); $table->decimal('amount', 15, 2)->default(0); $table->integer('transactionable_id')->unsigned()->nullable(); $table->string('transactionable_type', 50)->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('wallet_transactions'); } };
Back to File Manager