Database
Automatic setup
You do not normally have to do anything. On the first start the script creates all its tables, and every update upgrades them through numbered migrations that are logged in kaj_migrations.
This is controlled by ServerConfig.AutoDatabase = true in shared/server/config.lua.
If your database user is not allowed to create tables, import install/database.sql manually instead.
The tables
| Table | Holds |
|---|---|
kaj_facilities | Your hospitals and every point placed in them |
kaj_profiles | Per-character medical profile: blood type, chronic conditions, allergies |
kaj_records | Medical records, every encounter, report and discharge |
kaj_prescriptions | Issued prescriptions, refills and what has been collected |
kaj_report_templates | Report templates built in the tablet |
kaj_settings | Live settings, EMS jobs, rank permissions, insurance plans |
kaj_vehicles | Medic-owned department vehicles and their upgrades |
kaj_training | EMS Academy results, best score and time per medic, per scenario |
kaj_bodies | Permadeath bodies, their state and decomposition |
kaj_fck_grants | Permadeath approvals granted by admins |
kaj_migrations | Which schema migrations have run |
Record retention
By default medical records are kept forever.
To prune them automatically, set a number of days in shared/server/config.lua:
ServerConfig.RecordRetentionDays = 90 -- false = keep foreverBacking up
The only tables you really need in a backup are kaj_facilities (your hospital layouts) and kaj_settings (your jobs, permissions and live settings). Everything else is player data that regenerates.
You can also export a hospital as JSON from the creator, Hospitals → Export. That is the easiest way to move a hospital between servers or share an MLO setup.