Files
backend/database/migrations/2025_07_30_153041_create_harims_table.php
2025-07-30 17:28:22 +03:30

54 lines
1.8 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->foreignId('state_id')->constrained('harim_states');
$table->string('state_name');
$table->string('first_name');
$table->string('last_name');
$table->string('phone_number');
$table->string('request_number');
$table->date('request_date');
$table->unsignedTinyInteger('province_id');
$table->foreign('province_id')->references('id')->on('provinces');
$table->string('province_name');
$table->unsignedSmallInteger('city_id');
$table->foreign('city_id')->references('id')->on('cities');
$table->string('city_name');
$table->unsignedBigInteger('edareh_shahri_id');
$table->foreign('edareh_shahri_id')->references('id')->on('edarate_shahri');
$table->string('county');
$table->string('division');
$table->string('village');
$table->integer('grand_area');
$table->integer('plan_area');
$table->string('requested_organization');
$table->string('plan_group');
$table->string('plan_title');
$table->string('address');
$table->string('file');
$table->polygon('polygon');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('harims');
}
};