- portal.ejs: add TZ flag+prefix pill (+255), section divider between
plans and payment, hint text showing format (0765 123 456)
- engine.js: auto-format phone as user types into groups 4-3-3
(0765 123 456); strips non-digits and caps at 10 digits
- migrate.js: add cleanup UPDATEs before MODIFY COLUMN to reset any
invalid ENUM values before altering the column definition
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix status ENUM truncation and add pre-query debug logging
- migrate.js: add migrations 004/005 to MODIFY access_tokens.status
and payments.status ENUMs so older live DBs get the missing values
('unused', 'completed', 'refunded') without a wipe
- webhooks.routes.js: log all status writes before each query so the
last visible log before a Processing error pinpoints the exact statement
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(portal): add device_portal_settings migration and fix NOT NULL columns
- Create table if it doesn't exist with all columns nullable
- MODIFY bg_color and primary_color to DEFAULT NULL on pre-existing tables
- Fix ON DUPLICATE KEY UPDATE to use row alias instead of deprecated VALUES()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add migration runner that executes before server start
Migrations are idempotent — errno 1060 (duplicate column) is silently
skipped so they are safe to run on every boot.
First migration adds ssid_name, ssid_password, omada_wlan_id, omada_ssid_id
to the devices table for existing installations.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>