mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
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.
19 lines
655 B
SQL
19 lines
655 B
SQL
CREATE TABLE IF NOT EXISTS audit_logs (
|
|
id TEXT PRIMARY KEY,
|
|
event_type TEXT NOT NULL,
|
|
user_id TEXT,
|
|
api_key_id TEXT,
|
|
description TEXT NOT NULL,
|
|
ip_address TEXT,
|
|
user_agent TEXT,
|
|
request_id TEXT,
|
|
event_metadata TEXT,
|
|
status_code INTEGER,
|
|
error_message TEXT,
|
|
created_at INTEGER NOT NULL
|
|
);
|
|
CREATE INDEX IF NOT EXISTS audit_logs_created_at_idx ON audit_logs (created_at);
|
|
CREATE INDEX IF NOT EXISTS audit_logs_event_type_idx ON audit_logs (event_type);
|
|
CREATE INDEX IF NOT EXISTS audit_logs_request_id_idx ON audit_logs (request_id);
|
|
CREATE INDEX IF NOT EXISTS audit_logs_user_id_idx ON audit_logs (user_id);
|