Add schema reconciliation migration and file removal in bulk upload
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m38s
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m38s
Migration: - Add standalone hasConflict index on ConflictOfInterest - Ensure roundId is nullable on ConflictOfInterest - Drop stale composite roundId_hasConflict index Bulk upload: - Add trash icon button to remove uploaded files - Uses existing file.delete endpoint with audit logging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
-- =============================================================================
|
||||
-- Schema Reconciliation: Fill remaining gaps between migrations and schema.prisma
|
||||
-- =============================================================================
|
||||
-- All statements are idempotent (safe to re-run on any database state).
|
||||
|
||||
-- 1. ConflictOfInterest: add standalone hasConflict index (schema has @@index([hasConflict]))
|
||||
-- Migration 20260205223133 only created composite (roundId, hasConflict) index.
|
||||
CREATE INDEX IF NOT EXISTS "ConflictOfInterest_hasConflict_idx" ON "ConflictOfInterest"("hasConflict");
|
||||
|
||||
-- 2. Ensure ConflictOfInterest.roundId is nullable (schema says String?)
|
||||
-- Pipeline migration (20260213) makes it nullable, but guard for safety.
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "ConflictOfInterest" ALTER COLUMN "roundId" DROP NOT NULL;
|
||||
EXCEPTION WHEN others THEN NULL;
|
||||
END $$;
|
||||
|
||||
-- 3. Drop stale composite index that no longer matches schema
|
||||
-- Schema only has @@index([hasConflict]) and @@index([userId]), not (roundId, hasConflict).
|
||||
DROP INDEX IF EXISTS "ConflictOfInterest_roundId_hasConflict_idx";
|
||||
Reference in New Issue
Block a user