unsignedBigInteger('id')->autoIncrement(); $table->unsignedBigInteger('section_id'); $table->unsignedBigInteger('parent_id')->nullable(); $table->string('value', 255); $table->smallInteger('sort_order')->default(0); $table->index('section_id', 'idx_section'); $table->index('parent_id', 'idx_parent'); $table->foreign('section_id')->references('id')->on('dict_sections')->onDelete('cascade'); $table->foreign('parent_id')->references('id')->on('dict_values')->onDelete('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('dict_values'); } };