2024-08-01 13:53:10 -05:00
|
|
|
<?php
|
|
|
|
|
|
2025-01-28 17:33:54 -06:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2024-08-10 13:30:34 -05:00
|
|
|
use Illuminate\Database\Migrations\Migration;
|
2025-01-28 17:14:49 -06:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
2024-08-01 13:53:10 -05:00
|
|
|
|
2024-08-03 14:21:29 -05:00
|
|
|
class CreateSplitsTable extends Migration
|
2024-08-01 13:53:10 -05:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Run the migrations.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function up()
|
|
|
|
|
{
|
2024-08-03 14:21:29 -05:00
|
|
|
Schema::create('splits', function (Blueprint $table) {
|
2025-01-28 17:14:49 -06:00
|
|
|
$table->uuid('id')->primary();
|
2024-08-03 14:21:29 -05:00
|
|
|
$table->date('date');
|
2025-03-10 21:17:24 -05:00
|
|
|
$table->string('symbol', 25);
|
2024-08-03 14:21:29 -05:00
|
|
|
$table->float('split_amount', 12, 4);
|
2024-08-01 13:53:10 -05:00
|
|
|
$table->timestamps();
|
2025-03-19 16:16:38 -05:00
|
|
|
|
|
|
|
|
$table->unique(['date', 'symbol']);
|
2024-08-01 13:53:10 -05:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Reverse the migrations.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function down()
|
|
|
|
|
{
|
2024-08-03 14:21:29 -05:00
|
|
|
Schema::dropIfExists('splits');
|
2024-08-01 13:53:10 -05:00
|
|
|
}
|
2024-08-03 14:21:29 -05:00
|
|
|
}
|