Jason Cameron wrote in post #984994:
> I'd like to use migrations to add/remove/modify columns from a database.
> Rails makes that relatively painless.  One feature I don't see is the
> ability to comment on columns in the schema.  How can I add a column
> comment to a migration?
>
> We're using Oracle/PosgreSQL (and we're thinking of adding SQL Server in
> the future.)
>
> The SQL for adding a comment to a column is oddly enough the same for
> all three it seems but I'd rather not take a chance.
>
> COMMENT ON COLUMN table_name.column_name IS 'Random Comment';

It's possible run whatever SQL you like using "execute" in a migration. 
I don't think this is a common enough problem to add to the DSL of 
migrations.

So for the above add this to your migration:

execute "COMMENT ON COLUMN table_name.column_name IS 'Random Comment'"

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to