id(); $table->string('title', 500)->comment('報告標題'); $table->integer('year')->comment('報告年份'); $table->text('summary')->nullable()->comment('報告簡介'); $table->string('cover_image', 500)->nullable()->comment('封面圖相對路徑'); $table->enum('download_type', ['upload', 'link']) ->default('upload') ->comment('下載類型: upload=上傳檔案, link=外部連結'); $table->string('download_file', 500)->nullable()->comment('上傳檔案相對路徑'); $table->string('download_url', 500)->nullable()->comment('外部下載連結'); $table->dateTime('published_at')->nullable()->comment('發布時間'); $table->enum('status', ['draft', 'publish'])->default('draft')->comment('發布狀態'); $table->timestamps(); $table->index('year', 'idx_reports_year'); $table->index('status', 'idx_reports_status'); $table->index('published_at', 'idx_reports_published_at'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('reports'); } };