takeone-laravel-tournament/database/migrations/2025_07_30_143734_create_members_table.php
2025-07-30 18:01:17 +03:00

37 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMembersTable extends Migration
{
public function up()
{
Schema::create('members', function (Blueprint $table) {
$table->id();
$table->string('unique_id', 50)->unique();
$table->string('name');
$table->string('picture')->nullable(); // store filename or URL, can be null
$table->enum('gender', ['male', 'female']);
$table->date('date_of_birth');
$table->string('nationality')->nullable();
$table->decimal('weight', 5, 2); // e.g., 123.45 kg max
$table->decimal('height', 5, 2)->nullable(); // e.g., 250.00 cm max
$table->json('contact_info')->nullable(); // phones, emails as JSON
$table->json('social_media')->nullable(); // social media links as JSON
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('members');
}
}