> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_mdt/integrations/database.md).

# Database

`rcore_mdt` stores incidents, records, BOLOs, case files, boards, messages, and department data in the database.

## 🗄️ Supported Databases

| Resource       | Supported   |
| -------------- | ----------- |
| `oxmysql`      | Recommended |
| `ghmattimysql` | Yes         |

## 🔎 Auto Detection

The database resource is detected automatically. Leave this setting as `nil` in `configs/sv_config.lua`:

```lua
SV_CONFIG.MysqlType = nil
```

## 🧾 Tables

The script creates and updates its tables automatically on startup.

| Group      | Tables                                                                                                                                 |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Officers   | `police_users`, `police_user_stats`                                                                                                    |
| Incidents  | `incidents`, `incident_criminals`, `incident_officers`, `incident_civilians`, `incident_charges`, `incident_tags`, `incident_evidence` |
| Penal code | `penal_codes`, `fines`                                                                                                                 |
| BOLOs      | `bolos`, `bolo_person`, `bolo_vehicle`                                                                                                 |
| Vehicles   | `mdt_vehicle_flags`, `mdt_vehicle_notes`                                                                                               |
| Case files | `case_file_categories`, `case_file_topics`, `case_file_comments`                                                                       |
| Boards     | `evidence_boards`                                                                                                                      |
| Messages   | `message_groups`, `message_group_members`, `messages`, `message_attachments`                                                           |
| Department | `bulletin_board`, `mdt_notifications`                                                                                                  |
| Medical    | `mdt_medical_records`                                                                                                                  |

## 👥 Framework Tables

Civilians and vehicles are read from your framework's tables. The MDT does not change them.

| Framework  | Civilians | Vehicles          |
| ---------- | --------- | ----------------- |
| ESX        | `users`   | `owned_vehicles`  |
| QBCore/QBX | `players` | `player_vehicles` |
