<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;

class DatabaseSeeder extends Seeder
{
    public function run(): void
    {
        DB::unprepared(file_get_contents(database_path('seed.sql')));

        DB::table('users')->updateOrInsert(
            ['username' => 'superadmin'],
            [
                'school_id' => null,
                'password' => Hash::make('ChangeMe@1405'),
                'first_name' => 'Super',
                'last_name' => 'Admin',
                'role_key' => 'super_admin',
                'status' => 'active',
                'must_change_password' => true,
                'must_complete_profile' => true,
                'created_at' => now(),
                'updated_at' => now(),
            ]
        );
    }
}
