Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

400 B
Raw Blame
-- Add unique constraint to lessonCompletion to prevent duplicate completions
ALTER TABLE "lessonCompletion"
ADD CONSTRAINT "unique_lesson_completion" UNIQUE ("userId", "courseId", "lessonId");

-- Add unique constraint to challengeAttempt to prevent multiple passed attempts
CREATE UNIQUE INDEX "unique_passed_challenge" ON "challengeAttempt" ("userId", "courseId", "topicId") 
WHERE passed = true;