<?php

namespace App\Database\Seeds;

use CodeIgniter\Database\Seeder;

class RoleSeeder extends Seeder
{
    public function run(): void
    {
        $existing = $this->db->table('roles')->where('slug', 'administrator')->get()->getRow();
        if ($existing) {
            return;
        }

        $this->db->table('roles')->insert([
            'name'        => 'Administrator',
            'slug'        => 'administrator',
            'description' => 'Full, unrestricted access to every module. Cannot be deleted.',
            'is_system'   => 1,
            'created_at'  => date('Y-m-d H:i:s'),
            'updated_at'  => date('Y-m-d H:i:s'),
        ]);
    }
}
