diff --git a/backend/prisma/migrations/20260428000000_add_stream_event_unique_constraint/migration.sql b/backend/prisma/migrations/20260428000001_add_stream_event_unique_constraint/migration.sql similarity index 100% rename from backend/prisma/migrations/20260428000000_add_stream_event_unique_constraint/migration.sql rename to backend/prisma/migrations/20260428000001_add_stream_event_unique_constraint/migration.sql diff --git a/backend/prisma/migrations/20260428161500_add_stream_pause_fields/migration.sql b/backend/prisma/migrations/20260428161500_add_stream_pause_fields/migration.sql index ca29c456..596bfc87 100644 --- a/backend/prisma/migrations/20260428161500_add_stream_pause_fields/migration.sql +++ b/backend/prisma/migrations/20260428161500_add_stream_pause_fields/migration.sql @@ -1,7 +1,8 @@ --- AlterTable -ALTER TABLE "Stream" ADD COLUMN "isPaused" BOOLEAN NOT NULL DEFAULT false; -ALTER TABLE "Stream" ADD COLUMN "pausedAt" INTEGER; -ALTER TABLE "Stream" ADD COLUMN "totalPausedDuration" INTEGER NOT NULL DEFAULT 0; +-- The pause-state columns (isPaused, pausedAt, totalPausedDuration) are added by +-- the earlier migration `20260428000000_add_pause_state_fields`, which is the +-- single source of truth for them. This migration only adds the index, so that a +-- fresh `prisma migrate deploy` no longer fails with +-- `column "isPaused" of relation "Stream" already exists`. -- CreateIndex -CREATE INDEX "Stream_isPaused_idx" ON "Stream"("isPaused"); +CREATE INDEX IF NOT EXISTS "Stream_isPaused_idx" ON "Stream"("isPaused"); diff --git a/backend/src/__tests__/integration/streams.test.ts b/backend/src/__tests__/integration/streams.test.ts index 7bc157b6..f26cfd6d 100644 --- a/backend/src/__tests__/integration/streams.test.ts +++ b/backend/src/__tests__/integration/streams.test.ts @@ -20,6 +20,10 @@ const { mockPrisma, mockSseService } = vi.hoisted(() => ({ }, streamEvent: { create: vi.fn(), + // `upsert` + `findUnique` back the worker's duplicate-event guard + // (soroban-event-worker.ts handleStreamCreated/handleStreamCancelled, + // ~L360/L558). Don't remove them or the indexer tests fail to load + // with "is not a function" — this regressed Backend CI in #527. upsert: vi.fn(), findUnique: vi.fn().mockResolvedValue(null), findMany: vi.fn().mockResolvedValue([]),