Your current create_table should appear in the self.up section of the
migration… self.down should undo any operation that self.up performs
There’s nothing stopping you from adding another create_table statement
as long as its properly formatted.
You’ll probably hear all sorts of opinions about mixing more than one
action in a single migration step. If you do create more than one
table, realize that the migration becomes an all or nothing choice, both
tables or neither.
You can code it however you want of course, but what is so bad about
adding another migration for the message comments?
From my point of view, what you really want is a polymorphic join
between comments and several (at least two) other models in your
application. Check out has_many_polymorphs, and simplify your
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.