Okay, so it turns out that does not work either. Here is the actual
syntax:
execute "ALTER TABLE tablename CHANGE column_name column_name
TIMESTAMP DEFAULT CURRENT_TIMESTAMP"
You have to put the column name in twice as well as specify the datatype
again.
Also, you may be wondering why I am responding to a 7 year old
question... I came across it on google and there was NOTHING else out
there to help with this issue. Yes, I know Rails creates timestamps for
you. However, when you are polling a database that can have information
entered from other sources, it is useful to be able to do this.
--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1ee7a581fbe17410589863813be92bb2%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment