Files
scrum-poker-internal/database/migrations/2026_08_14_164147_create_votes_table.php
T
2026-08-15 13:35:46 +02:00

33 lines
833 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('votes', function (Blueprint $table) {
$table->id();
$table->foreignId('player_id')->constrained()->cascadeOnDelete();
$table->foreignUuid('room_id')->constrained()->cascadeOnDelete();
$table->unsignedInteger('round');
$table->string('value', 16);
$table->timestamps();
$table->unique(['player_id', 'room_id', 'round']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('votes');
}
};