Skip to content
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

Fix triggers in remove aggregates tables pr #5451

Open
wants to merge 11 commits into
base: remove-aggregate-tables
Choose a base branch
from

Conversation

dullbananas
Copy link
Collaborator

#5407

Looks like BEFORE DELETE triggers can't update the row that the deletion is for, which happened in the delete_comments_before_post trigger because the comment trigger updates post.comments

@dessalines
Copy link
Member

dessalines commented Feb 24, 2025

Nice, thx. Needs a pg_format run:

find crates/db_schema/replaceable_schema/ -type f -name '*.sql' -exec pg_format -i {} +

EDIT: nm I'll get.

@Nutomic
Copy link
Member

Nutomic commented Feb 25, 2025

There is a syntax error somewhere in sql:

thread 'site::registration_applications::tests::test_application_approval' panicked at crates/db_schema/src/utils.rs:505:19:
db pool missing: LemmyError { message: Unknown("Failed to run SQL files in crates/db_schema/replaceable_schema"), inner: Failed to run SQL files in crates/db_schema/replaceable_schema

Caused by:
syntax error at or near "/"

Also there was a remaining usage of CommentAggregates which I fixed on my branch, so merge that to make the code compile.

@dessalines
Copy link
Member

The CI is showing that the trigger: CREATE TRIGGER search_combined_community_score needs to use the community table now instead of community_aggregates

@dessalines
Copy link
Member

@dullbananas
Copy link
Collaborator Author

i'll try to fix it right now

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

Successfully merging this pull request may close these issues.

3 participants