just to make sure
This commit is contained in:
parent
2849a8552a
commit
c2a4782f7f
10
app/Models/entities.php
Normal file
10
app/Models/entities.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class entities extends Model
|
||||
{
|
||||
//
|
||||
}
|
10
app/Models/person.php
Normal file
10
app/Models/person.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class person extends Model
|
||||
{
|
||||
//
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<?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('people', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->bigInteger("code")->unique()->nullable();
|
||||
$table->string("name", 50)->nullable();
|
||||
$table->date("birthdate")->nullable();
|
||||
$table->enum("gender", ['male', 'female'])->nullable();
|
||||
$table->json("nationality")->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('people');
|
||||
}
|
||||
};
|
@ -0,0 +1,35 @@
|
||||
<?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');
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user