Database
The Eleven Phone database on FiveM installs itself through oxmysql: which tables it creates, what it reads from Qbox, the license columns and data deletion.
Nothing to run
The resource reads sql/schema.sql on start and creates any missing tables; on update, it adds that version's new columns. Every table starts with eleven_phone_. The console prints a summary:
[eleven-phone] base de datos: 0 tabla(s) creada(s), 2 columna(s) añadida(s), 0 ajustada(s)
The sql/schema.sql file is there for reference, or for anyone who prefers to apply it by hand.
What it reads from outside
Only two tables, both from the framework:
| Table | What for |
|---|---|
players | Who each citizenid is, plus the licence columns if present. |
player_vehicles | Vehicles for the Garage app. |
Everything else goes through the adapters in External systems, and the phone never writes outside its own tables.
Licence columns
The Licences app reads some columns in players that the phone doesn't create: your licence script provides them. If you don't have one and want the app, add them with ALTER TABLE:
| Column | Type | What for |
|---|---|---|
license_car, license_motorcycle, license_truck, license_boat, license_aircraft, license_hunting, license_fishing | TINYINT(1) | Whether they hold each licence. |
theory_passed_car, theory_passed_motorcycle, theory_passed_truck, theory_passed_boat, theory_passed_aircraft, theory_passed_hunting, theory_passed_fishing | TINYINT(1) | Whether they passed the theory test. |
puntos | INT | Driving licence points. |
dni_expires_at | DATE | When the ID card expires. |
ALTER TABLE players
ADD COLUMN license_car TINYINT(1) NOT NULL DEFAULT 0,
ADD COLUMN theory_passed_car TINYINT(1) NOT NULL DEFAULT 0,
ADD COLUMN puntos INT NOT NULL DEFAULT 12,
ADD COLUMN dni_expires_at DATE NULL;
-- …and the same for the other licences
A licence whose column doesn't exist simply doesn't show. Without puntos or dni_expires_at, only that section is lost. If you don't want the app, switch it off with Config.FeatureFlags = { licencias = false }.
Devices and numbers
eleven_phone_devicesstores each number with its owner (owner).- Tables for what lives on the phone (contacts, gallery, notes, settings, apps, PIN…) carry the number in
phoneas well as the owner'scitizenid. eleven_phone_numbersstores each character's main number, which is what the exports read.- Cloud tables start with
eleven_phone_cloud. eleven_phone_paymentslogs payments sent through Messages, for the daily cap.
If a table is missing
The app that uses it opens and says it can't. The phone doesn't crash and the other apps carry on. Most retry every minute, so fixing the database with the server running is enough.
Deleting a player's data
Tables hang off players with ON DELETE CASCADE: deleting the character removes their contacts, messages, photos and notes.