# Site Content Schema Preparation

- **ID:** IPZ-SITE-CONTENT-SCHEMA-2026-08-13
- **Status:** DONE
- **Task:** 65
- **Source request:** Prepare the smallest dormant, backward-compatible Site Content database schema on current `origin/master`.

## Outcome

Add migration `1.8.0` that idempotently prepares the Site Content translation table and translation-job idempotency metadata, then marks itself applied only after complete schema verification. The schema remains dormant: it adds no controller, repository, route, UI, job, flag consumer, or feature activation.

## Acceptance criteria

- `1.8.0` is unused in the discovered migration registry.
- `create_tables()`, `verify_tables()`, and `verify_site_content_storage_schema()` agree on required Site Content table, job metadata columns, and indexes.
- Clean, existing, and partially migrated installs are safe and idempotent; incomplete schema cannot be marked applied.
- Focused test, PHP syntax, candidate-aware PHPCS/PHPStan, diff check, and commit hooks pass without unaddressed signals.

## Constraints

Only these files may change: `includes/Core/Database.php`, `includes/Migrations/Migration008SiteContentStorage.php`, `tests/Unit/SiteContent/SiteContentStorageSchemaTest.php`, narrow test bootstrap stubs if required, and this plan/index. Preserved WIP at `/home/user/Projects/Press.zone/wordpress/wp-content/.worktrees/remaining-release-orchestration` is read-only. No remote WordPress or browser use.

## Execution

1. Inspect migration discovery and applied-version semantics; confirm `1.8.0` is available.
2. Reconcile only required schema behavior from preserved WIP.
3. Add focused verification coverage for columns and indexes.
4. Run focused gates and commit.

## Current receipt

Created fresh worktree `/home/user/Projects/Press.zone/wordpress/wp-content/.worktrees/ipz-site-content-schema` from `origin/master`. Discovery keys migrations by version and applied versions live in `ipz_applied_migrations`; existing versions include `1.7.0`, leaving `1.8.0` available. Added dormant Site Content schema creation, complete column/index verification, migration `1.8.0`, focused tests, and narrow standalone bootstrap. Passed: focused PHPUnit (4 tests, 4 assertions), PHP syntax, PHPStan on affected source, new-file PHPCS, and `git diff --check`. `Database.php` has 745 pre-existing PHPCS errors and 46 warnings; formatting it would violate the surgical scope, while new code preserves its local style.

## Rollback

Do not destructively drop a created schema. A later contract migration must make any compatible schema change; this migration's `down()` only removes its applied marker.

## Next executable action

None. Commit `31df4e76d32c30c02e20f3cc33548ab2ea58d1ec` contains this complete dormant schema slice.
