fix: unblock Render deploy when Prisma migrations fail

Add missing milestones migration and fall back to db push so backend updates deploy successfully.
This commit is contained in:
EENE Dashboard
2026-06-05 22:12:00 +09:00
parent 6066b5682d
commit 1ba312fb42
2 changed files with 27 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
-- CreateTable (누락됐던 milestones 테이블 생성)
CREATE TABLE IF NOT EXISTS "milestones" (
"id" TEXT NOT NULL,
"taskId" TEXT NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT,
"startDate" TIMESTAMP(3),
"dueDate" TIMESTAMP(3),
"progress" INTEGER NOT NULL DEFAULT 0,
"links" TEXT,
"completedAt" TIMESTAMP(3),
"order" INTEGER NOT NULL DEFAULT 0,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "milestones_pkey" PRIMARY KEY ("id")
);
CREATE INDEX IF NOT EXISTS "milestones_taskId_idx" ON "milestones"("taskId");
DO $$ BEGIN
ALTER TABLE "milestones" ADD CONSTRAINT "milestones_taskId_fkey"
FOREIGN KEY ("taskId") REFERENCES "tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
EXCEPTION
WHEN duplicate_object THEN NULL;
END $$;

View File

@@ -3,7 +3,7 @@ services:
name: eene-dashboard-backend
runtime: node
rootDir: backend
buildCommand: npm install --include=dev && npx prisma migrate deploy && npx prisma generate && npm run build
buildCommand: npm install --include=dev && npx prisma migrate deploy || npx prisma db push && npx prisma generate && npm run build
startCommand: npm start
envVars:
- key: DATABASE_URL