Search code examples
ruby-on-railsdatabase-migrationphppgadmin

How to add comment to an existing table in Rails 5.0?


I am working with a ROR project, and I want to add comments to each tables. I can do this directly by altering the tables in phppgadmin, but I want to do this using migrations. I have searched a lot but no luck.

I tried to do the same in the following way:

def change
    set_table_comment :active_admin_comments, 'This table stores stuff.'
  end

But again no luck.


Solution

  • You should use migration_comments for adding comments in migration files. For more details visit migration_comments.