<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTblCommunity extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up(): void
    {
        Schema::create('tbl_community', function (Blueprint $table) {
            $table->bigIncrements('community_id');
            $table->string('member_name', 120);
            $table->string('member_sh_id', 50)->nullable();
            $table->string('father_name', 120)->nullable();
            $table->string('member_email', 120)->nullable();
            $table->string('member_phone', 20)->nullable();
            $table->tinyInteger('status');
            $table->string('dob', 12)->nullable();
            $table->string('doj', 12)->nullable();
            $table->string('designation', 100)->nullable();
            $table->string('panchayat', 120)->nullable();
            $table->text('address')->nullable();
            $table->string('jivika_name', 100)->nullable();
            $table->text('photo_url')->nullable();
            $table->integer('district_id');
            $table->integer('block_id');
            $table->string('shg_id', 30)->nullable();
            $table->enum('user_type', ['MEMBER', 'CM', 'CC', ''])->nullable();
            $table->integer('created_by');
            $table->integer('report_to')->nullable();
            $table->dateTime('created_at')->nullable();
            $table->integer('updated_by')->nullable();
            $table->dateTime('updated_at')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('tbl_community');
    }
}
