diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2023-12-06 15:08:52 -0500 |
|---|---|---|
| committer | Sebastien Castiel <sebastien@castiel.me> | 2023-12-06 15:08:52 -0500 |
| commit | 570aa713b1b2becf7c06c89610c75d2cb119b532 (patch) | |
| tree | b6e3ae339bd55a7a00d77ee64532ece9fc43c13f /prisma/migrations | |
| parent | fee1963284eafa6db7887103a156799b7610e13d (diff) | |
Delete expense
Diffstat (limited to 'prisma/migrations')
| -rw-r--r-- | prisma/migrations/20231206195936_add_cascades/migration.sql | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/prisma/migrations/20231206195936_add_cascades/migration.sql b/prisma/migrations/20231206195936_add_cascades/migration.sql new file mode 100644 index 0000000..4075d7a --- /dev/null +++ b/prisma/migrations/20231206195936_add_cascades/migration.sql @@ -0,0 +1,11 @@ +-- DropForeignKey +ALTER TABLE "ExpensePaidFor" DROP CONSTRAINT "ExpensePaidFor_expenseId_fkey"; + +-- DropForeignKey +ALTER TABLE "Participant" DROP CONSTRAINT "Participant_groupId_fkey"; + +-- AddForeignKey +ALTER TABLE "Participant" ADD CONSTRAINT "Participant_groupId_fkey" FOREIGN KEY ("groupId") REFERENCES "Group"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ExpensePaidFor" ADD CONSTRAINT "ExpensePaidFor_expenseId_fkey" FOREIGN KEY ("expenseId") REFERENCES "Expense"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
