Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Add relation constraints #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add relation constraints #91

wants to merge 1 commit into from

Conversation

robere2
Copy link
Member

@robere2 robere2 commented Mar 15, 2023

Relational fields within the database were almost all set to the default of "No Action" on delete/update. This PR fixes that by making all optional fields set to null on delete, and all required fields cascade on delete. Updates cascade for all relations, however that shouldn't be relevant since Glimpse never updates IDs.

One problem introduced by this is that cascaded rows now won't show up as deleted/updated in audit logs. It also means that users can get around their permissions to delete/update on these types of rows. The best solution may be to manually implement cascading within the code, rather than having it fall back to the database, and then essentially revert this commit.

This PR also changes the blog post author field to not be required.

This PR will require a database migration.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant