adeo-maturity-tool/server/migrations/003_access_log.sql
Phil Dore 1f537b8a3b Add Admin tab, Economics overview, Access Log, fix deliverables and gap data
- Merge Economics + Update Data into single Admin tab with sub-nav (Economics | Update Data | Access Log)
- Add Economics tab: per-market financial metrics parsed from Box MD files, card grid matching Markets dashboard style, drill-in detail view for key characteristics; admin-only
- Add Access Log: DB migration (003_access_log), login events recorded in auth.js, admin endpoint + frontend table showing user/action/IP/timestamp
- Fix deliverable downloads: copy PDFs/XLSXs to clients/adeo/deliverables/ and update deliverables.json paths to container-accessible locations
- Patch gap analysis: extract gaps from Question_XX_Analysis.md files in Box for all 8 markets (90 questions patched)
- Mobile: fix card grid minmax, modal max-width uses min(740px,90vw)
- Loading: replace invisible auth-loading with visible spinner overlay
- Add economic.json with key metrics for all 8 markets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 16:35:12 +01:00

10 lines
358 B
SQL

CREATE TABLE IF NOT EXISTS access_log (
id SERIAL PRIMARY KEY,
user_email TEXT NOT NULL,
action TEXT NOT NULL CHECK (action IN ('login', 'view', 'download')),
detail TEXT,
ip TEXT,
logged_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS access_log_logged ON access_log (logged_at DESC);