Files
Aether/crates/aether-data/migrations/mysql/20260504000000_add_audit_logs.sql
fawney19 fce7e959e5 Add multi-database data layer
Introduce aether-data-schema and driver-specific schema generation for Postgres, MySQL, and SQLite.

Split data backends, lifecycle, repositories, and gateway runtime integration across database drivers.

Verified with cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace.
2026-05-05 18:27:36 +08:00

19 lines
569 B
SQL

CREATE TABLE IF NOT EXISTS audit_logs (
id VARCHAR(64) PRIMARY KEY,
event_type VARCHAR(64) NOT NULL,
user_id VARCHAR(64),
api_key_id VARCHAR(64),
description TEXT NOT NULL,
ip_address VARCHAR(64),
user_agent VARCHAR(512),
request_id VARCHAR(128),
event_metadata TEXT,
status_code INT,
error_message TEXT,
created_at BIGINT NOT NULL,
KEY audit_logs_created_at_idx (created_at),
KEY audit_logs_event_type_idx (event_type),
KEY audit_logs_request_id_idx (request_id),
KEY audit_logs_user_id_idx (user_id)
);