mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Add cascade to sentEmail (#463)
* add delete cascade * add cascade to both
This commit is contained in:
parent
06746d8831
commit
b48172e337
@ -0,0 +1,5 @@
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "SentEmail" DROP CONSTRAINT "SentEmail_tenancyId_fkey";
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "SentEmail" ADD CONSTRAINT "SentEmail_tenancyId_fkey" FOREIGN KEY ("tenancyId") REFERENCES "Tenancy"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@ -0,0 +1,5 @@
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "SentEmail" DROP CONSTRAINT "SentEmail_tenancyId_userId_fkey";
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "SentEmail" ADD CONSTRAINT "SentEmail_tenancyId_userId_fkey" FOREIGN KEY ("tenancyId", "userId") REFERENCES "ProjectUser"("tenancyId", "projectUserId") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@ -944,8 +944,8 @@ model SentEmail {
|
||||
text String?
|
||||
|
||||
error Json?
|
||||
tenancy Tenancy @relation(fields: [tenancyId], references: [id])
|
||||
user ProjectUser? @relation(fields: [tenancyId, userId], references: [tenancyId, projectUserId])
|
||||
tenancy Tenancy @relation(fields: [tenancyId], references: [id], onDelete: Cascade)
|
||||
user ProjectUser? @relation(fields: [tenancyId, userId], references: [tenancyId, projectUserId], onDelete: Cascade)
|
||||
|
||||
@@id([tenancyId, id])
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user