fix: constraint error when deleting channel

This commit is contained in:
2025-12-18 23:37:24 +01:00
parent 5fdb6921d9
commit 0cabbd8720
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
-- DropForeignKey
ALTER TABLE "StreamKey" DROP CONSTRAINT "StreamKey_channelId_fkey";
-- AddForeignKey
ALTER TABLE "StreamKey" ADD CONSTRAINT "StreamKey_channelId_fkey" FOREIGN KEY ("channelId") REFERENCES "Channel"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@@ -109,7 +109,7 @@ model StreamKey {
key String @unique
channelId String @unique
channel Channel @relation(fields: [channelId], references: [id])
channel Channel @relation(fields: [channelId], references: [id], onDelete: Cascade)
}
model BotAccount {