Files
backend/database/migrations/2025_07_30_153041_create_harims_table.php
2025-09-07 14:25:10 +03:30

60 lines
2.2 KiB
PHP

<?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('harims', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('panjare_vahed_id');
$table->string('national_id');
$table->string('phone_number');
$table->foreignId('state_id')->constrained('harim_states');
$table->string('state_name');
$table->date('request_date');
$table->unsignedTinyInteger('province_id');
$table->foreign('province_id')->references('id')->on('provinces');
$table->string('province_name');
$table->unsignedSmallInteger('city_id')->nullable();
$table->foreign('city_id')->references('id')->on('cities');
$table->string('city_name')->nullable();
$table->unsignedBigInteger('edareh_shahri_id');
$table->foreign('edareh_shahri_id')->references('id')->on('edarate_shahri');
$table->string('requested_organization');
$table->string('plan_group');
$table->string('plan_title');
$table->boolean('is_possible')->nullable();
$table->string('worksheet_id');
$table->json('response_options')->nullable();
$table->string('isic');
$table->json('primary_area');
$table->json('forbidden_area')->nullable();
$table->json('final_area')->nullable();
$table->json('final_plan')->nullable();
$table->json('access_road')->nullable();
$table->boolean('need_payment')->nullable();
$table->string('payment_amount')->nullable();
$table->boolean('need_access_road')->nullable();
$table->boolean('access_road_allowed')->nullable();
$table->string('lat')->nullable();
$table->string('lng')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('harims');
}
};