su-secret-santa/database/migrations/2025_12_04_105253_add_parti...

39 lines
943 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('participants', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id');
$table->unsignedBigInteger('giving_id')->nullable();
$table->foreign('giving_id')->references('id')->on('participants')->onDelete('set null');
$table->string('prompt')->nullable();
$table->string('submission_url')->nullable();
$table->string('token');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('participants');
}
};