# PT-003 — Existing Database Schema Inspector

Upload `myinfo-pt003.zip` to `/home/bikinev2/myinfo`.

```bash
unzip -o /home/bikinev2/myinfo/myinfo-pt003.zip -d /home/bikinev2/myinfo
cd /home/bikinev2/myinfo
php -v
php -l backend/src/Database/SchemaInspector.php
php -l backend/src/Database/SchemaReport.php
php -l backend/scripts/inspect_schema.php
php -l backend/tests/schema_report_test.php
php backend/tests/schema_report_test.php
php backend/scripts/inspect_schema.php
```

Expected final output includes:

```text
PASS: read-only schema inspection completed.
Report: docs/DATABASE_EXISTING_SCHEMA.md
Database objects found: [actual count]
Tables found: 6/6
```

The report contains authoritative table/column/index metadata,
nullable/default/collation values, primary keys, operational schema warnings, and
Latitude/Longitude presence. It does not compare physical column names against the
Blueprint's logical examples. It omits the
configured database name, credentials, and all master-table row data.

The inspector applies the approved mapping in
`docs/ADR-001_EXISTING_MASTER_TABLE_MAPPING.md`; it does not rename database tables.
Physical hosting tables and columns are authoritative. A schema change is proposed only
for a concrete requirement and must receive the user's explicit approval before execution.

After the command succeeds, download this generated file from cPanel File Manager:

```text
/home/bikinev2/myinfo/docs/DATABASE_EXISTING_SCHEMA.md
```

Send that file back for authoritative review and synchronization into the repository.
PT-003 is not complete until the generated hosting report has been reviewed.

If `Tables found` is `0/6`, inspect the `Selected database inventory` section in the
generated report. An empty inventory means `DB_NAME` likely selects an empty/different
database. A non-empty inventory with zero targets means actual table names differ from
the Blueprint names. Do not rename tables or change DB_NAME without reviewing the report.
