update migrations

This commit is contained in:
hackerESQ
2024-08-03 14:21:29 -05:00
parent 395fa95eb5
commit 227b5f5aa1
8 changed files with 224 additions and 0 deletions
@@ -0,0 +1,39 @@
<?php
use App\Models\Portfolio;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateHoldingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('holdings', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Portfolio::class, 'portfolio_id')->onDelete('cascade');
$table->string('symbol');
$table->float('quantity', 12, 4);
$table->float('average_cost_basis', 12, 4);
$table->float('total_cost_basis', 12, 4)->nullable();
$table->float('realized_gain_loss_dollars', 12, 4)->nullable();
$table->float('dividends_earned', 12, 4)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('holdings');
}
}