Loading database/migrations/2024_06_18_013012_create_subgrupos_table.php 0 → 100644 +33 −0 Original line number Diff line number Diff line <?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('subgrupos', function (Blueprint $table) { $table->id(); $table->string('nombre'); $table->unsignedBigInteger('grupo_id')->nullable(); $table->unsignedBigInteger('subgrupo_id')->nullable(); $table->foreign('grupo_id')->references('id')->on('grupos')->nullable(); $table->foreign('subgrupo_id')->references('id')->on('subgrupos')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('subgrupos'); } }; Loading
database/migrations/2024_06_18_013012_create_subgrupos_table.php 0 → 100644 +33 −0 Original line number Diff line number Diff line <?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('subgrupos', function (Blueprint $table) { $table->id(); $table->string('nombre'); $table->unsignedBigInteger('grupo_id')->nullable(); $table->unsignedBigInteger('subgrupo_id')->nullable(); $table->foreign('grupo_id')->references('id')->on('grupos')->nullable(); $table->foreign('subgrupo_id')->references('id')->on('subgrupos')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('subgrupos'); } };