# Database documentation

Migrations currently create `facilities`, `roles`, `users`, `role_user`, `password_reset_tokens`, `sessions`, `patients`, `encounters` and `audit_logs`. Patient records are globally numbered; the originating facility is retained. Encounters are facility-scoped and refer to a central patient. Signed encounters are locked through the application workflow and should be amended by a separately audited amendment workflow before production use. JSON fields are used for initial allergy and medical-history notes; production terminology, structured clinical coding and consent records require further design.
