# Sub Dictionary: `sql_logs`

## Table Info

| Property | Value |
|----------|-------|
| Table | `sql_logs` |
| Database | laravel_logs |
| Connection | `logs` |
| Engine | InnoDB |
| Type | TABLE |
| Category | Logging |
| Laravel Model | `SQLLog` (app/Models/SQLLog.php) |

## Columns

| # | Column | Type | Nullable | Default | Key | Extra | Description |
|---|--------|------|----------|---------|-----|-------|-------------|
| 1 | `id` | `bigint unsigned` | NO | - | PRI | auto_increment | Auto-increment primary key |
| 2 | `platform` | `enum('admin','web','partner')` | NO | - | MUL | - | Source platform of the query |
| 3 | `sql_query` | `longtext` | NO | - | - | - | Full SQL query with bindings replaced |
| 4 | `time_taken` | `decimal(10,3)` | NO | - | MUL | - | Query execution time in milliseconds |
| 5 | `file` | `varchar(255)` | YES | NULL | - | - | File or class where the query was executed |
| 6 | `line` | `int` | YES | NULL | - | - | Line number in the file |
| 7 | `method` | `varchar(255)` | YES | NULL | - | - | Method or function name |
| 8 | `url` | `varchar(500)` | YES | NULL | - | - | Request URL |
| 9 | `request_method` | `varchar(10)` | YES | NULL | - | - | HTTP method (GET, POST, etc.) |
| 10 | `user_id` | `bigint unsigned` | YES | NULL | - | - | User ID if authenticated |
| 11 | `ip_address` | `varchar(45)` | YES | NULL | - | - | Client IP address |
| 12 | `created_at` | `timestamp` | NO | `CURRENT_TIMESTAMP` | MUL | DEFAULT_GENERATED | Laravel timestamp (created) |

## Indexes

| Name | Columns | Unique | Type |
|------|---------|--------|------|
| `PRIMARY` | `id` | YES | BTREE |
| `sql_logs_created_at_index` | `created_at` | NO | BTREE |
| `sql_logs_platform_created_at_index` | `platform`, `created_at` | NO | BTREE |
| `sql_logs_platform_index` | `platform` | NO | BTREE |
| `sql_logs_time_taken_index` | `time_taken` | NO | BTREE |

## Foreign Keys

### Formal Foreign Keys

None defined.

