ctran / annotate_models

Annotate Rails classes with schema and routes info
Other
4.41k stars 598 forks source link

feat: add COMMENT support to indexes #1006

Open olleolleolle opened 8 months ago

olleolleolle commented 8 months ago

This reads out any COMMENT added to an INDEX object and adds its after the last output on its "details" line.

An example of what this looks like:

 # Indexes
 #
-#  attestations_avoid_same_employee  (attested_by_employee_id,subject_id,subject_type) UNIQUE
+#  attestations_avoid_same_employee  (attested_by_employee_id,subject_id,subject_type) UNIQUE COMMENT My explanatory comment is right here

EDIT: I added a test case after I had made it possible to run them locally on newer Ruby versions, in #1007