Skip to content

[Feature request] Place column comments at the end of the line #953

Closed
@Epigene

Description

@Epigene

Hi, kudos for maintaining a most useful gem.

My problem is that column comments from Rails migrations are being placed in brackets just after column name, needlessly pushing everything else far to the right.

What is happening

In migration I have this

add_column(
 :rfps, :options, :jsonb,
  null: false, default: {},
  comment: "Unified place for event options, suff like :public, *_flag, etc.",
)

Then annotation is something like this:

# == Schema Information
#
# Table name: rfps
#
#  id                                                                        :bigint           not null, primary key
#  deleted_at                                                                :datetime         indexed => [currency_id, bid_submission_deadline, state], indexed => [currency_id], indexed
#  options(Unified place for event options, suff like :public, *_flag, etc.) :jsonb            default({}), not null

What would be better

Putting the comment at the end of the line would produce less whitespace in the middle of lines:

# == Schema Information
#
# Table name: rfps
#
#  id         :bigint    not null, primary key
#  deleted_at :datetime  indexed => [currency_id, bid_submission_deadline, state], indexed => [currency_id]
#  options    :jsonb     default({}), not null, comment => "Unified place for event options, suff like :public, *_flag, etc."

Version

  • annotate version 3.2.0
  • rails version 6.0.4.8
  • ruby version 2.7.5

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