This repository has been archived on 2026-11-17. You can view files and clone it, but cannot push or open issues or pull requests.
gitgram-ai/aitimemachine/api-server/drizzle/0008_add_checkpoint_test_status.sql
caelum0x 54ca6de161 feat: round-4 product build-out (50 more gaps closed, all 7 green ~94-100%)
Second deep audit→build→verify pass; all products typecheck clean.

- gitgram-web (100): fix feed pagination, reel drafts, 6 gaps
- gitgram-backend (99): add admin/moderator role checks to moderation routes;
  wire backend-e2e CI (Postgres+Redis services); 5 gaps
- gitgram-mobile (97): fix broken create-reel flow; 11 gaps
- aitm-core (98): dedupe vendored CLI command registrations; real vector search
  with local fallback; 7 gaps
- aitm-api (99): replace hash-based embeddings with real OpenAI/Voyage embeddings
  (+ checkpoints test_status migration 0008); 8 gaps
- aitm-mcp (99): add X-API-Key to workspace tool proxy calls; 8 gaps
- aitm-website (94): fix annual billing checkout; 5 gaps

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 14:44:42 +03:00

20 lines
1.1 KiB
SQL

-- Migration: add structured test/build status columns to `checkpoints`
-- Source: api-server last-green detection (routes/restore.ts) — replaces fuzzy
-- name-substring matching ('green'/'passed'/'success') with an authoritative
-- boolean signal so test-status-based green checkpoints are found reliably.
-- Notes:
-- - tests_passed: nullable boolean. null = unknown, true = tests passed,
-- false = tests failed. This is the column last-green detection queries.
-- - test_status: richer label (passed | failed | unknown | skipped).
-- - Additive + idempotent (ADD COLUMN IF NOT EXISTS). Existing rows get NULL
-- (= unknown), and the last-green endpoint falls back to name matching for
-- those legacy checkpoints.
ALTER TABLE checkpoints ADD COLUMN IF NOT EXISTS tests_passed BOOLEAN;
ALTER TABLE checkpoints ADD COLUMN IF NOT EXISTS test_status TEXT;
-- Partial index to make "most recent passing checkpoint per project" cheap.
CREATE INDEX IF NOT EXISTS idx_checkpoints_tests_passed
ON checkpoints (project_id, user_id, created_at)
WHERE tests_passed = true;