This commit is contained in:
KM Koushik
2025-08-10 09:10:54 +10:00
parent 46b2b64847
commit 1a8d23db3b
3 changed files with 6 additions and 17 deletions

View File

@@ -1,14 +0,0 @@
/*
Warnings:
- Added the required column `teamId` to the `EmailEvent` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "EmailEvent" ADD COLUMN "teamId" INTEGER NOT NULL;
-- CreateIndex
CREATE INDEX "EmailEvent_teamId_idx" ON "EmailEvent"("teamId");
-- AddForeignKey
ALTER TABLE "EmailEvent" ADD CONSTRAINT "EmailEvent_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "EmailEvent" ADD COLUMN "teamId" INTEGER;
-- CreateIndex
CREATE INDEX "EmailEvent_teamId_idx" ON "EmailEvent"("teamId");

View File

@@ -118,7 +118,6 @@ model Team {
subscription Subscription[]
invites TeamInvite[]
suppressionList SuppressionList[]
emailEvents EmailEvent[]
}
model TeamInvite {
@@ -262,10 +261,9 @@ model EmailEvent {
emailId String
status EmailStatus
data Json?
teamId Int
teamId Int?
createdAt DateTime @default(now())
email Email @relation(fields: [emailId], references: [id], onDelete: Cascade)
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
@@index([emailId])
@@index([teamId])