<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('uid')->nullable();
            $table->string('email',100);
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password', 100)->nullable();
            $table->string('name');

            $table->text('bio')->nullable();

            $table->string('phone')->nullable();
            $table->boolean('is_phone_verified')->default(0);

            $table->text('image_url')->nullable();
            $table->foreignId('province_id')->nullable();

            $table->text('latitude')->nullable();
            $table->text('longitude')->nullable();

            $table->string('cm_firebase_token')->nullable();
            $table->string('type')->default('user');
            $table->integer('following_count')->default(0);
            $table->integer('follower_count')->default(0);

            $table->boolean('status')->default(true);

            $table->rememberToken();
            $table->timestamps();
        });
    }

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