# Database schema overview

The migrations in this starter define the following application-owned tables. The fresh Laravel skeleton supplies the standard `users` table migration; this starter adds the `role` column to that table.

| Table | Main fields | Purpose |
|---|---|---|
| users (Laravel default + role) | name, email, password, role | Accounts; `user` or `admin` role |
| categories | name, slug, description, icon, is_active, sort_order | Tool categories |
| tools | category_id, name, slug, descriptions, formats, processing_key, SEO fields, active/featured flags | Dynamic tool catalogue and landing pages |
| conversion_jobs | user_id, guest_token_hash, tool_id, status, error fields, timestamps, expires_at, ip_hash | Tracks guest and registered-user processing jobs |
| conversion_files | conversion_job_id, disk, path, original_name, mime_type, size_bytes, file_role, sha256 | Private input/output file metadata |

Foreign keys: `tools.category_id` references categories; `conversion_jobs.user_id` references users and becomes null if a user is deleted; `conversion_jobs.tool_id` references tools; `conversion_files.conversion_job_id` cascades when a job is deleted. Files themselves must be removed from private storage by a cleanup process before/when their database records are deleted.

Security notes: guest access uses a hash of a random token, not a sequential job ID. The first processing implementation must generate and return the raw token once, store only its SHA-256 hash, and authorize every status/download request against that token. Do not store raw IP addresses unless a documented operational need and retention policy justify it.
