<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('admins', function(Blueprint $table){
            $table->string('id')->primary();
            $table->string('email');
            $table->string('password_hash');
        });

        $qb = DB::table('admins');
        $qb->insert([
            'id' => uniqid('admin_'),
            'email' => 'mail@mail.com',
            'password_hash' => Hash::make('password'),
        ]);
    }

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