search for: jc_rubyonrails

Displaying 1 result from an estimated 1 matches for "jc_rubyonrails".

2007 Apr 15
1
help:How to set default value for a column use of migration?
...create_table :messages do |t| t.column :name, :string t.column :content, :text t.column :posttime, :datetime, :default => "now()" end end def self.down drop_table :messages end end it can''t work sucessfully.And the error like this: (in G:/Jc_RubyonRails/InstantRails/rails_apps/guestbook) == CreateMessages: migrating ================================================== -- create_table(:messages) rake aborted! Mysql::Error: Invalid default value for ''posttime'': CREATE TABLE messages (`id` int(11) DEFAULT NULL auto_increment PRIMARY K...