# SPCHS final schema review

The package was reconstructed from the uploaded final project ZIP and the two uploaded SQL files.

## Confirmed final application tables

- `users`
- `schools`
- `equipment_master`
- `unit_master`
- `unit_equipment`
- `surveys`
- `survey_equipment_details`
- `survey_other_units`
- `survey_other_equipment`
- `activity_logs`

## Important correction made

The older `02_survey_wizard.sql` added an `equipment_name` column to `survey_equipment_details` as `NOT NULL`. The final PHP code no longer inserts that column; it stores `equipment_id` and joins `equipment_master` to display the name. Therefore, the final schema intentionally does **not** include `survey_equipment_details.equipment_name`.

## Existing files confirmed in the uploaded final ZIP

- `admin/activity_logs.php`
- `includes/activity_log.php`
- final `login.php`
- final `logout.php`
- survey create/update/delete logging
- user, unit, equipment, and school-import modules

## Data not recoverable from source code

The old user records, school records, and submitted surveys were database data, not application source. They cannot be reconstructed from the ZIP unless they also existed in a dump. This package recreates their final structures and default master data.

## Mapping note

The original exact unit-to-equipment rows were not present as a database dump. `04_unit_equipment_mapping.sql` supplies a practical default mapping that can be edited through Equipment Management.
