feat:增加数据库迁移文件

This commit is contained in:
2026-05-08 11:12:09 +08:00
parent d780a2e249
commit 3f0bdda4e1
11 changed files with 359 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
<?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();
$table->string('draw_no', 32)->unique();
$table->date('business_date');
$table->unsignedInteger('sequence_no');
$table->string('status', 32);
$table->timestamp('start_time')->nullable();
$table->timestamp('close_time')->nullable();
$table->timestamp('draw_time')->nullable();
$table->timestamp('cooling_end_time')->nullable();
$table->string('result_source', 16)->nullable()->comment('rng|manual');
$table->unsignedInteger('current_result_version')->default(0);
$table->unsignedInteger('settle_version')->default(0);
$table->boolean('is_reopened')->default(false);
$table->timestamps();
$table->index(['status', 'draw_time'], 'idx_draws_status_draw_time');
});
}
public function down(): void
{
Schema::dropIfExists('draws');
}
};