8000 feat(db): add cascade actions to notes by domhhv · Pull Request #241 · domhhv/habitrack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(db): add cascade actions to notes #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions supabase/migrations/20250505134221_notes_cascade_actions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ALTER TABLE "public"."notes" DROP CONSTRAINT "notes_occurrence_id_fkey";

ALTER TABLE "public"."notes" ADD CONSTRAINT "notes_occurrence_id_fkey"
FOREIGN KEY ("occurrence_id") REFERENCES "occurrences" ("id")
ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;

ALTER TABLE "public"."notes" VALIDATE CONSTRAINT "notes_occurrence_id_fkey";
0