DND Docs

Resourcesdnd_phoneInstallation

Database Setup

Last updated on

Nothing manual is required in normal operation — see Installation. This page documents the schema for reference/troubleshooting.

Source files

  • install/database.sql — full CREATE TABLE IF NOT EXISTS schema, applied automatically on resource start.
  • server/migrations.lua — idempotent additive migrations (new columns/indexes on existing tables), also applied automatically on every start via DB.EnsureColumn / DB.EnsureIndex (they inspect the live schema first, so re-running is always safe).

Tables

TablePurpose
dnd_phone_devicesOne row per physical phone device: device_id, serial, owner identifier, model, settings (JSON), battery/battery_health, charging state
dnd_phone_numbersPhone number ↔ device_id mapping, avatar
dnd_phone_contactsPer-device saved contacts (favorite/blocked flags)
dnd_phone_call_logsCall history (incoming/outgoing/missed, duration)
dnd_phone_threadsMessage threads (private + group)
dnd_phone_messagesIndividual messages (text/image/location), metadata JSON
dnd_phone_group_membersGroup chat membership
dnd_phone_gallerySaved photos (Camera/Gallery)
dnd_phone_bank_historymBanking transaction history, per account_id
dnd_phone_bank_saved_accountsSaved payees
dnd_phone_installed_appsStore app's show/hide state
dnd_phone_user_preferencesPer-device UI preferences (notification sound, etc.)
dnd_phone_accountsAccount recovery: email/password/security question (plain text), display name
dnd_phone_mailMail app messages, optional money attachment
dnd_phone_job_reportsJob app emergency reports
dnd_phone_job_report_repliesThreaded staff replies to job reports
dnd_phone_birdie_accountsBirdie (social app) accounts, notify scope
dnd_phone_birdie_postsBirdie posts/replies
dnd_phone_birdie_likesBirdie likes
dnd_phone_birdie_repostsBirdie reposts
dnd_phone_birdie_followsBirdie follow graph
dnd_phone_cab_tripsDowntown Cab Co. trip records (ride/delivery), tips, street names
dnd_phone_gps_waypointsGPS app saved pins
dnd_phone_adsAdvertise app classifieds listings
dnd_phone_notesNotepad app notes

Notable migrated columns

Applied automatically, listed here for visibility if you're diffing a manually-imported schema:

  • dnd_phone_devices: battery_health, is_charging, charging_station (JSON), data_plan_expires_at
  • dnd_phone_numbers: avatar
  • dnd_phone_bank_history: account_id
  • dnd_phone_threads: group_id
  • dnd_phone_user_preferences: preferred_notification_sound
  • dnd_phone_contacts: email
  • dnd_phone_cab_trips: note, customer_name, driver_name, tip_total, pickup_street, dropoff_street
  • dnd_phone_accounts: display_name
  • dnd_phone_birdie_accounts: notify_scope

No separate tables for

  • Dark Chat (bridged to dnd_blackmarketplace's own tables via exports)
  • Economy Market (read-only, bridged to dnd_economy's own data via exports)
  • Job app duty/salary/roster data (bridged to dnd_jobmanagement's own tables via exports — only emergency reports/replies live in dnd_phone's own tables)

Metadata storage

  • Item metadata (ox_inventory): device_id, serial number on the phone item; charge/health on the powerbank item.
  • Device settings (JSON in dnd_phone_devices.settings): language, dark mode, wallpaper, sounds, volume, brightness, accent color, etc.

On this page