Make migrations idempotent and add missing tables

- Make all pending migrations idempotent (safe to re-run)
- Disable decouple_projects_from_rounds migration (schema not changed)
- Add ProjectTag table for AI tagging
- Add AssignmentJob table for AI assignment progress

On server deployment, run: npx prisma migrate deploy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-05 11:09:37 +01:00
parent 05862f1e55
commit e37154d812
7 changed files with 86 additions and 102 deletions

View File

@@ -1,5 +1,5 @@
-- CreateTable
CREATE TABLE "AIUsageLog" (
CREATE TABLE IF NOT EXISTS "AIUsageLog" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"userId" TEXT,
@@ -21,13 +21,7 @@ CREATE TABLE "AIUsageLog" (
);
-- CreateIndex
CREATE INDEX "AIUsageLog_userId_idx" ON "AIUsageLog"("userId");
-- CreateIndex
CREATE INDEX "AIUsageLog_action_idx" ON "AIUsageLog"("action");
-- CreateIndex
CREATE INDEX "AIUsageLog_createdAt_idx" ON "AIUsageLog"("createdAt");
-- CreateIndex
CREATE INDEX "AIUsageLog_model_idx" ON "AIUsageLog"("model");
CREATE INDEX IF NOT EXISTS "AIUsageLog_userId_idx" ON "AIUsageLog"("userId");
CREATE INDEX IF NOT EXISTS "AIUsageLog_action_idx" ON "AIUsageLog"("action");
CREATE INDEX IF NOT EXISTS "AIUsageLog_createdAt_idx" ON "AIUsageLog"("createdAt");
CREATE INDEX IF NOT EXISTS "AIUsageLog_model_idx" ON "AIUsageLog"("model");