-- Site configuration & user activity audit

CREATE TABLE IF NOT EXISTS SiteConfig (
  id VARCHAR(191) PRIMARY KEY,
  config_key VARCHAR(100) NOT NULL UNIQUE,
  config_value TEXT,
  createdAt DATETIME DEFAULT CURRENT_TIMESTAMP,
  updatedAt DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS UserAction (
  id VARCHAR(191) PRIMARY KEY,
  userId VARCHAR(191),
  visitorId VARCHAR(191),
  actionType VARCHAR(50) NOT NULL,
  entityType VARCHAR(50),
  entityId VARCHAR(191),
  metadata TEXT,
  createdAt DATETIME DEFAULT CURRENT_TIMESTAMP
);