mirror of
https://github.com/documenso/documenso
synced 2026-04-21 13:27:18 +00:00
fix: allow nullable document audit logs (#2682)
This commit is contained in:
parent
4c69cb9c66
commit
7cb64c3d04
2 changed files with 10 additions and 2 deletions
|
|
@ -0,0 +1,8 @@
|
|||
-- DropForeignKey
|
||||
ALTER TABLE "DocumentAuditLog" DROP CONSTRAINT "DocumentAuditLog_envelopeId_fkey";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "DocumentAuditLog" ALTER COLUMN "envelopeId" DROP NOT NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "DocumentAuditLog" ADD CONSTRAINT "DocumentAuditLog_envelopeId_fkey" FOREIGN KEY ("envelopeId") REFERENCES "Envelope"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
|
@ -466,7 +466,7 @@ model EnvelopeItem {
|
|||
|
||||
model DocumentAuditLog {
|
||||
id String @id @default(cuid())
|
||||
envelopeId String
|
||||
envelopeId String?
|
||||
createdAt DateTime @default(now())
|
||||
type String
|
||||
data Json
|
||||
|
|
@ -478,7 +478,7 @@ model DocumentAuditLog {
|
|||
userAgent String?
|
||||
ipAddress String?
|
||||
|
||||
envelope Envelope @relation(fields: [envelopeId], references: [id], onDelete: Cascade)
|
||||
envelope Envelope? @relation(fields: [envelopeId], references: [id], onDelete: SetNull)
|
||||
|
||||
@@index([envelopeId])
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue