Kartik Scripts

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

TableHolds
kaj_facilitiesYour hospitals and every point placed in them
kaj_profilesPer-character medical profile: blood type, chronic conditions, allergies
kaj_recordsMedical records, every encounter, report and discharge
kaj_prescriptionsIssued prescriptions, refills and what has been collected
kaj_report_templatesReport templates built in the tablet
kaj_settingsLive settings, EMS jobs, rank permissions, insurance plans
kaj_vehiclesMedic-owned department vehicles and their upgrades
kaj_trainingEMS Academy results, best score and time per medic, per scenario
kaj_bodiesPermadeath bodies, their state and decomposition
kaj_fck_grantsPermadeath approvals granted by admins
kaj_migrationsWhich 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 forever

Backing 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.

On this page