perf(test): make schema-dump target + opt-in fast-path docs (WS-6)
Session 2.6's per-test migrate:fresh in 4 backfill test classes replays ~120 migrations. Laravel's schema:dump produces a single SQL file that migrate:fresh loads atomically when present — significantly faster on environments where the host has the \`mysql\` CLI available for Laravel's load step. Changes: - New Makefile target \`schema-dump\` runs mysqldump INSIDE the bm_mysql Docker container (no host mysqldump dependency to GENERATE the dump). Outputs api/database/schema/mysql-schema.sql. - api/database/schema/.gitignore added: mysql-schema.sql is NOT committed by default. Laravel's auto-load on migrate:fresh shells out to the host's \`mysql\` CLI; on hosts without it, the presence of the dump file actively breaks migrate (exit 127). Treat the dump as opt-in per dev environment. - CLAUDE.md "Schema dumps (opt-in fast path)" subsection added with the workflow: brew install mysql-client → migrate to head → make schema-dump → optionally commit. phpstan-baseline.neon: removed a stale "unused use \$actor" entry in FormSubmissionService whose underlying closure pint cleaned up in commit060d6f3(Task 1). Wall-time on this dev machine (no host mysql CLI): NO speedup, backfill tests still ~6s per setUp. The dump file is ready for environments that have mysql CLI. Documented as a deviation. JSON canonicalization (commit060d6f3) is the load-bearing correctness fix from this branch; the schema-dump perf path is a nice-to-have that activates per-environment. Refs: WS-6 session 2.6 deviation #5 cleanup Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
4
api/database/schema/.gitignore
vendored
Normal file
4
api/database/schema/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Schema dumps are environment-specific and require mysql CLI on host
|
||||
# for Laravel's auto-load. NOT committed by default. See CLAUDE.md
|
||||
# "Schema dumps (opt-in fast path)".
|
||||
mysql-schema.sql
|
||||
Reference in New Issue
Block a user