1

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Amrinder Singh
  • 5,300
  • 12
  • 46
  • 88

2 Answers2

0

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

Uday kumar das
  • 1,615
  • 16
  • 33
0

As of Rails 5 you can do this natively with change_table_comment

def change
  change_table_comment :active_admin_comments, 'This table stores stuff.'
end
Yarin
  • 173,523
  • 149
  • 402
  • 512