bestofjs / bestofjs

:star: A place to find the best components to build amazing web applications. The best of JavaScript!
https://bestofjs.org
MIT License
2.72k stars 144 forks source link

Migration backend / Database relations "delete cascade" #293

Closed michaelrambeau closed 3 months ago

michaelrambeau commented 3 months ago

Goal

Improve database relations to enable "delete cascade": deleting a repo should delete the related records:

This PR also adds:

How to test

delete from repos where full_name = 'wildhaber/gluebert'

Before the migration:

ERROR:  update or delete on table "repos" violates foreign key constraint "projects_repoId_repos_id_fk" on table "projects"
DETAIL:  Key (id)=(59bfc357f612c80011c7c11d) is still referenced from table "projects".
vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bestofjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2024 5:05am
bestofjs-classic ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2024 5:05am
bestofjs-static-api-v2 ❌ Failed (Inspect) Aug 4, 2024 5:05am