chore: Add relation between a host and a membership for future cascades (#22975)

* chore: Add relation between a host and a membership for future cascades

* Apply suggestion

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Alex van Andel
2025-08-08 13:06:02 +01:00
committed by GitHub
co-authored by coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
parent e29b7e83b8
commit aaa59f1455
@@ -0,0 +1,11 @@
-- AlterTable
ALTER TABLE "Host" ADD COLUMN "memberId" INTEGER;
-- AddForeignKey
ALTER TABLE "Host" ADD CONSTRAINT "Host_memberId_fkey"
FOREIGN KEY ("memberId")
REFERENCES "Membership"("id")
ON DELETE CASCADE
ON UPDATE CASCADE;
CREATE INDEX "Host_memberId_idx" ON "Host"("memberId");