add structured logging for admin/partage form submissions + migration system

- AppLogger: JSON-line logger in storage/logs/form-submissions.log
- Logs submissions (admin + partage) with IP, UA, thesis ID, author
- Logs errors with context (post keys, share slug)
- Migration runner (app/migrations/run.php) handles schema drift
- 001_add_objet_column.sql fixes production DB missing 'objet' column
- ThesisCreateController::getIdentifier() helper for logging
This commit is contained in:
Pontoporeia
2026-04-24 16:55:11 +02:00
parent decb9e2907
commit 4986fa74f4
9 changed files with 344 additions and 10 deletions

View File

@@ -0,0 +1,7 @@
-- Add 'objet' column to theses table if it doesn't already exist.
-- Required: the admin form sends 'objet' in POST since commit ~Apr 2024
-- but older production databases may lack the column.
-- SQLite 3.35+ supports ALTER TABLE ADD COLUMN (bundled with PHP 8+).
ALTER TABLE theses ADD COLUMN objet TEXT NOT NULL DEFAULT 'tfe'
CHECK (objet IN ('tfe', 'thèse', 'frart'));