Files
shinkan-jinkendo/backend/migrations/102_exercise_api_offering.sql
T
LarsandCursor b59b7eae16
Deploy Development / deploy (push) Successful in 53s
Test Suite / pytest-backend (push) Failing after 29s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 16s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Failing after 7m42s
Offer the current exercise through an explicit API switch.
The exercise list turns the live catalog on or off for the caller's edit rights. A distribution key reads that current selection and the changes since its last cursor.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-23 15:37:25 +01:00

19 lines
687 B
SQL

-- Auswahl, welche Übungen der aktuelle Abruf ausliefert. Frühere Lieferpakete schalten das nicht mit ein.
ALTER TABLE exercises
ADD COLUMN IF NOT EXISTS api_offered BOOLEAN NOT NULL DEFAULT FALSE;
CREATE INDEX IF NOT EXISTS idx_exercises_api_offered
ON exercises (id)
WHERE api_offered = TRUE;
CREATE TABLE IF NOT EXISTS distribution_catalog_snapshots (
id UUID PRIMARY KEY,
binding_id UUID NOT NULL REFERENCES distribution_bindings (id),
snapshot JSONB NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_distribution_catalog_snapshots_binding
ON distribution_catalog_snapshots (binding_id, created_at DESC);