2025-12-31 01:56:50 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
|
|
return new class extends Migration
|
|
|
|
|
{
|
|
|
|
|
public function up(): void
|
|
|
|
|
{
|
|
|
|
|
Schema::create('draws', function (Blueprint $table) {
|
|
|
|
|
$table->id();
|
2026-03-19 20:34:47 +01:00
|
|
|
$table->uuid('uuid')->unique();
|
2025-12-31 01:56:50 +01:00
|
|
|
$table->foreignId('bucket_id')->constrained()->onDelete('cascade');
|
|
|
|
|
$table->unsignedBigInteger('amount');
|
|
|
|
|
$table->date('date');
|
|
|
|
|
$table->text('description')->nullable();
|
|
|
|
|
$table->boolean('is_projected')->default(true);
|
|
|
|
|
$table->timestamps();
|
|
|
|
|
|
|
|
|
|
$table->index(['bucket_id', 'date']);
|
|
|
|
|
$table->index('is_projected');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function down(): void
|
|
|
|
|
{
|
|
|
|
|
Schema::dropIfExists('draws');
|
|
|
|
|
}
|
|
|
|
|
};
|