<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\Models\User;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('email');
            $table->string('password');
            $table->string('avatar');
            $table->text('comment')->default('');
            $table->enum('role', ['user', 'admin', 'employer']);
            $table->boolean('blocked')->default("0");
            $table->timestamps();
        });

        $user = new User();
        $user->name = "awd1";
        $user->email = "awd1@mail.ru";
        $user->avatar = "awd1";
        $user->comment = "awd1";
        $user->password = "awd1";
        $user->role = "admin";
        $user->save();
    }

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