fix(mpc-service): 修复PostgreSQL兼容性问题
1. Dockerfile: 将DATABASE_URL协议从mysql改为postgresql 2. schema.prisma: 重命名索引以满足PostgreSQL全局唯一性要求 - idx_party_id -> idx_ps_party_id (party_shares) - idx_session_id -> idx_ps_session_id (party_shares) - idx_status -> idx_ps_status (party_shares) - idx_session_id -> idx_ss_session_id (session_states) - idx_party_id -> idx_ss_party_id (session_states) - idx_status -> idx_ss_status (session_states) 已在WSL2中验证Docker构建成功。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
a9594ef15e
commit
b224e209a6
|
|
@ -17,7 +17,7 @@ COPY prisma ./prisma/
|
|||
RUN npm ci
|
||||
|
||||
# Generate Prisma client (dummy DATABASE_URL for build time only)
|
||||
RUN DATABASE_URL="mysql://user:pass@localhost:3306/db" npx prisma generate
|
||||
RUN DATABASE_URL="postgresql://user:pass@localhost:5432/db" npx prisma generate
|
||||
|
||||
# Copy source code
|
||||
COPY src ./src
|
||||
|
|
@ -44,7 +44,7 @@ RUN npm ci --only=production
|
|||
|
||||
# Copy Prisma schema and generate client (dummy DATABASE_URL for build time only)
|
||||
COPY prisma ./prisma/
|
||||
RUN DATABASE_URL="mysql://user:pass@localhost:3306/db" npx prisma generate
|
||||
RUN DATABASE_URL="postgresql://user:pass@localhost:5432/db" npx prisma generate
|
||||
|
||||
# Copy built files
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ model PartyShare {
|
|||
lastUsedAt DateTime? @map("last_used_at")
|
||||
|
||||
@@unique([partyId, sessionId], name: "uk_party_session")
|
||||
@@index([partyId], name: "idx_party_id")
|
||||
@@index([sessionId], name: "idx_session_id")
|
||||
@@index([status], name: "idx_status")
|
||||
@@index([partyId], name: "idx_ps_party_id")
|
||||
@@index([sessionId], name: "idx_ps_session_id")
|
||||
@@index([status], name: "idx_ps_status")
|
||||
@@map("party_shares")
|
||||
}
|
||||
|
||||
|
|
@ -57,9 +57,9 @@ model SessionState {
|
|||
completedAt DateTime? @map("completed_at")
|
||||
|
||||
@@unique([sessionId, partyId], name: "uk_session_party")
|
||||
@@index([sessionId], name: "idx_session_id")
|
||||
@@index([partyId], name: "idx_party_id")
|
||||
@@index([status], name: "idx_status")
|
||||
@@index([sessionId], name: "idx_ss_session_id")
|
||||
@@index([partyId], name: "idx_ss_party_id")
|
||||
@@index([status], name: "idx_ss_status")
|
||||
@@map("session_states")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue