id(); $table->string('hashkey')->unique(); $table->string('name'); $table->enum('level', ['national', 'region', 'province', 'city', 'barangay']); $table->unsignedBigInteger('parent_id')->nullable(); $table->string('location_key')->nullable()->comment('Normalized slug for auto-matching UserInfo address fields'); $table->decimal('lat', 10, 7)->nullable(); $table->decimal('lng', 10, 7)->nullable(); $table->boolean('is_active')->default(true); $table->unsignedBigInteger('created_by')->nullable(); $table->unsignedBigInteger('updated_by')->nullable(); $table->timestamps(); $table->foreign('parent_id')->references('id')->on('chapters')->nullOnDelete(); $table->index(['level', 'is_active']); $table->index('location_key'); }); } public function down(): void { Schema::dropIfExists('chapters'); } }