-
Remove redundant WHERE from event queries · 9a3e4b8dYorick Peterse authored
The default scope in Event would add a "WHERE author_id IS NOT NULL" clause to every query. Now that "events.author_id" has a NOT NULL clause set this filter is redundant and we can safely remove it. In this commit we also add a validation on events.author_id (previously only defined in PushEvent) just in case something tries to create data without an author ID. This way we can present a nicer error message compared to PostgreSQL's foreign key error messages. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/38129
×