-- 0002_audit_and_snapshots.sql
CREATE TABLE IF NOT EXISTS audit_events (
  id TEXT PRIMARY KEY,
  ts DATETIME DEFAULT CURRENT_TIMESTAMP,
  user_id TEXT,
  action TEXT,
  resource_type TEXT,
  resource_id TEXT,
  success INTEGER DEFAULT 1,
  details TEXT
);

CREATE TABLE IF NOT EXISTS datasets (
  name TEXT PRIMARY KEY,
  pool TEXT,
  type TEXT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS snapshots (
  id TEXT PRIMARY KEY,
  dataset TEXT,
  name TEXT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
