Files
JQC_features/add_admin.sql
T
2026-07-22 14:50:16 -04:00

18 lines
717 B
SQL

-- Additive migration: adds the audit_log table required by the admin panel.
-- Run this against an ALREADY-DEPLOYED jqc_features database that predates the
-- admin feature. Safe to re-run (IF NOT EXISTS). New deploys don't need it —
-- schema.sql already includes this table.
USE jqc_features;
CREATE TABLE IF NOT EXISTS audit_log (
id INT AUTO_INCREMENT PRIMARY KEY,
actor VARCHAR(80) NULL,
action VARCHAR(40) NOT NULL,
entity VARCHAR(40) NOT NULL,
entity_id INT NULL,
detail VARCHAR(255) NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
KEY idx_audit_created (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;