takeone-laravel/database/migrations/2025_03_14_235329_create_entities_table.php
2025-03-16 01:33:04 +03:00

36 lines
1.0 KiB
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('entities', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->unsignedBigInteger('parent_id')->nullable(); // foreign key to parent entity
$table->string('type'); // e.g. 'club', 'federation', 'shop', etc.
$table->string('description')->nullable();
$table->string('address')->nullable();
$table->string('city')->nullable();
$table->string('country')->nullable();
$table->json('contacts')->nullable(); // JSON field for multiple contact information
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('entities');
}
};