You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.7 KiB

1 month ago
<?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('competitions', function (Blueprint $table) {
$table->id();
$table->string('slug', 64)->comment('URL 标识,唯一');
$table->string('name', 200)->comment('赛事名称');
$table->text('description')->nullable();
$table->string('status', 32)->default('draft')->index('idx_competitions_status')->comment(
'draft/published/signup_open/signup_closed/reviewing/ended'
);
$table->boolean('published')->default(false);
$table->dateTime('signup_open_at')->nullable();
$table->dateTime('signup_close_at')->nullable();
$table->unsignedBigInteger('form_schema_id')->nullable()->comment('当前生效的报名表 Schema');
$table->unsignedBigInteger('pledge_document_id')->nullable()->comment('本场绑定的承诺书文档版本');
$table->unsignedBigInteger('review_form_schema_id')->nullable()->comment('评审打分 Schema');
$table->json('branding_json')->nullable()->comment('多端展示文案与 logo 等');
$table->json('settings')->nullable()->comment('扩展业务参数');
$table->json('scoring_rules_json')->nullable()->comment('本场计分与聚合规则,空=默认');
$table->timestamps();
$table->unique('slug', 'uk_competitions_slug');
});
}
public function down(): void
{
Schema::dropIfExists('competitions');
}
};