- Task 1: Admin endpoints for wallet management
- Task 2: AI Credits admin UI (pricing.tsx, credit.tsx)
- Task 3: Ollama security (NetworkPolicy, prompt validation, audit)
- Task 4: LiteLLM integration (litellm.rs, migrated AI feature handlers)
- Task 5: Refund architecture (ai_refunds table, endpoints)
- Task 6: Coupons, promotions, referrals (order creation with coupon)
- Task 7: Subscription lifecycle (plan upgrades/downgrades, cron jobs)
- Task 8: Credit expiration enforcement (daily cron task)
- Task 9: Token cost engine (ai_model_cost_config, margin view)
- Task 10: Observability (metrics tables, aggregation function)
Cherry-picked from main branch commit 3c0f45f
12 lines
416 B
PL/PgSQL
12 lines
416 B
PL/PgSQL
-- Add prompt_preview and response_preview columns to ai_usage_logs
|
|
-- for audit logging (Task 3 - Ollama Security Hardening)
|
|
|
|
BEGIN;
|
|
|
|
ALTER TABLE ai_usage_logs
|
|
ADD COLUMN IF NOT EXISTS prompt_preview VARCHAR(200),
|
|
ADD COLUMN IF NOT EXISTS response_preview VARCHAR(200);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_ai_usage_logs_prompt_preview ON ai_usage_logs(prompt_preview) WHERE prompt_preview IS NOT NULL;
|
|
|
|
COMMIT;
|