CREATE TABLE IF NOT EXISTS audit_logs (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  user_id INT NULL,
  username VARCHAR(190) NULL,
  method VARCHAR(10) NOT NULL,
  url VARCHAR(1024) NOT NULL,
  ip VARCHAR(100) NULL,
  user_agent VARCHAR(512) NULL,
  status INT NOT NULL,
  action VARCHAR(190) NULL,
  resource VARCHAR(190) NULL,
  resource_id VARCHAR(190) NULL,
  payload JSON NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
