Skip to content

Removal of final empty comment line after foreign keys results in duplicate fk_rails_... line #297

@ZimbiX

Description

@ZimbiX

Somebody on our team removed the final empty comment line on one of our models, to be:

# Foreign Keys
#
#  fk_rails_...  (delivered_session_id => delivered_sessions.id)

rather than what had been generated by annotaterb previously:

# Foreign Keys
#
#  fk_rails_...  (delivered_session_id => delivered_sessions.id)
#

Now running bundle exec annotaterb models results in:

[...]
# Foreign Keys
#
#  fk_rails_...  (delivered_session_id => delivered_sessions.id)
#
#  fk_rails_...  (delivered_session_id => delivered_sessions.id)

Relevant portion of the table schema from psql:

Foreign-key constraints:
    "fk_rails_9100988ca9" FOREIGN KEY (delivered_session_id) REFERENCES delivered_sessions(id)

Reproduced in annotaterb v4.20.0.

Rails 7.0.8.1

We place the annotations at the end of the file, in case that matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions