From c2a4782f7f8868ecb651a24c47a793e63157d1bf Mon Sep 17 00:00:00 2001 From: GhassanYusuf Date: Sun, 16 Mar 2025 01:33:04 +0300 Subject: [PATCH] just to make sure --- app/Models/entities.php | 10 ++++++ app/Models/person.php | 10 ++++++ .../2025_03_14_233746_create_people_table.php | 32 +++++++++++++++++ ...025_03_14_235329_create_entities_table.php | 35 +++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 app/Models/entities.php create mode 100644 app/Models/person.php create mode 100644 database/migrations/2025_03_14_233746_create_people_table.php create mode 100644 database/migrations/2025_03_14_235329_create_entities_table.php diff --git a/app/Models/entities.php b/app/Models/entities.php new file mode 100644 index 0000000..df7488c --- /dev/null +++ b/app/Models/entities.php @@ -0,0 +1,10 @@ +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'); + } +}; diff --git a/database/migrations/2025_03_14_235329_create_entities_table.php b/database/migrations/2025_03_14_235329_create_entities_table.php new file mode 100644 index 0000000..b69134c --- /dev/null +++ b/database/migrations/2025_03_14_235329_create_entities_table.php @@ -0,0 +1,35 @@ +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'); + } +};