Parameterize console.php; make Commit Mission atomic

- Config 'Update', 'Commit Mission', lock, and clearupdate now use db.php
  helpers with bound params (were injectable via ~20 raw $_GET values incl.
  nummercs and playerid). Pod toggles collapsed into a 16-iteration loop.
- Commit Mission runs under the shared queue lock and one transaction so a
  registration can't slip into the mission mid-commit.
- dev/migrations/002: pqs_currentmission + pqs_pastmissions -> InnoDB so the
  commit's snapshot/archive roll back with the queue delete (uses DELETE not
  TRUNCATE to stay in the transaction).

Verified: commit moves players to current/past, empties queue, marks completed
with nummercs; config update writes pods + settings; no errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-01 13:59:27 -05:00
co-authored by Claude Opus 4.8
parent 905c46c4c4
commit 5aa01db123
2 changed files with 101 additions and 106 deletions
@@ -0,0 +1,13 @@
-- Migration 002: convert the mission-commit tables to InnoDB.
--
-- Why: console.php "Commit Mission" now snapshots to pqs_currentmission and
-- archives to pqs_pastmissions inside a transaction (with the queue delete +
-- mission completion). For that to roll back cleanly on error, these two must
-- be InnoDB as well. (DELETE, not TRUNCATE, is used on pqs_currentmission so it
-- stays inside the transaction.)
--
-- Safe and reversible; run once:
-- mysql -u pqs -ppqs pqs < dev/migrations/002-innodb-commit-tables.sql
ALTER TABLE pqs_currentmission ENGINE=InnoDB;
ALTER TABLE pqs_pastmissions ENGINE=InnoDB;