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'); + } +};