Iñaki Baz Castillo wrote:
El Martes, 19 de Enero de 2010, Iñaki Baz Castillo escribió:
I've also tryed with:

   column :modified, DateTime, :default => Sequel::SQL::Function.new(:now)

and:

   column :modified, DateTime, :default => :now.sql_function

but no luck, it raises an error:

"Sequel::DatabaseError: Mysql::Error: Invalid default value for 'modified'"

But both methods work for Postgres !!!

So it seems a bug, am I right?

http://dev.mysql.com/doc/refman/5.1/en/data-type-defaults.html

10.1.4. Data Type Default Values
The DEFAULT value clause in a data type specification indicates a default value for a column. With one exception, the default value must be a constant; it cannot be a function or an expression. This means, for example, that you cannot set the default for a date column to be the value of a function such as NOW() or CURRENT_DATE. The exception is that you can specify CURRENT_TIMESTAMP as the default for a TIMESTAMP column. See Section 10.3.1.1, “TIMESTAMP Properties”.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-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/sequel-talk?hl=en.


Reply via email to