Skip to content

Reserved keyword 'end' causes PostgreSQL queries to throw errors #2

@seanjhulse

Description

@seanjhulse

I noticed this error this morning. Trying to use this database model with a live application causes errors because we've used the reserved word 'end' in the DB model. It was causing syntax errors to be thrown in my project while trying to filter out data.

Error log:

ActionView::Template::Error (PG::SyntaxError: ERROR: syntax error at or near "end"
LINE 1: ...* FROM "events" WHERE "events"."user_id" = 2 AND (end < '201...

Solution:

Update the database model to use the keyword 'ends' instead of 'end'. I've made a PR this afternoon that should fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions