# location_state ## Purpose The **location_state** table stores dynamic operational status information for all facility locations. It represents the real-time condition of each zone or sector, including containment status, hazard presence, and active response actions triggered by SCP activity, incidents, or security events. This table separates static facility structure from runtime operational behavior. ## Columns | Field | Type | Description |--------------|--------------|---------------------------------------------------------| | id_loc | SMALLINT | Location identifier (PK, FK) | state | ENUM | Current operational state of the location | hazard_type | VARCHAR(100) | Type of active hazard affecting the location (NULLABLE) | response_type| VARCHAR(100) | Operational response being executed (NULLABLE) | last_update | DATETIME | Timestamp of last state change |---------------------------------------------------------------------------------------| ### ENUM values - state = ('normal','locked_down','maintenance','compromised','unknown') ## Relationships - References **location.id_loc** through **location_state.id_loc** to store runtime state of a location ## Rules - `hazard_type` and `response_type` must be `NULL` when `state` value = 'normal'. - `last_update` must be updated on every state change. ## Example output +--------+-------------+-------------+-----------------+---------------------+ | id_loc | state | hazard_type | response_type | last_update | +--------+-------------+-------------+-----------------+---------------------+ | 10 | locked_down | biological | decontamination | 2026-06-30 14:40:23 | +--------+-------------+-------------+-----------------+---------------------+