I you have been using Rails for development, you probably already know how to write migrations and their importance. One of the few things that Rails has traditionally not supported (and you have to install gems for it) was comments on tables and columns.
With Rails 5.2, that is no longer the case and Rails itself will allow you to create, change and delete comments on a Table and Column. Let’s get to it.
IMPORTANT NOTE: Read the comments in the code snippet
Table Comments
The following snippet performs creation, removal and updation of comments from tables
Column Comments
The following snippet performs creation, removal and updation of comments from columns.
NOTE
This is known to work only with ActiveRecord 5.2 which ships with Rails 5.2. I’m not sure if is supported in previous versions of Rails 5.x. It’s definitely is not available in Rails 4.