Doctrine unsigned validation error storing created_at
- by Alex Dean
Hi, I'm having problems with the Timestampable functionality in Doctrine 1.2.2.
The error I get on trying to save() my Record is:
Uncaught exception 'Doctrine_Validator_Exception' with message 'Validation failed in class XXX 1 field had validation error: * 1 validator failed on created_at (unsigned) ' in ...
I've created the relevant field in the MySQL table as:
created_at DATETIME NOT NULL,
Then in setTableDefinition() I have:
$this->hasColumn('created_at', 'timestamp', null, array(
'type' => 'timestamp',
'fixed' => false,
'unsigned' => false,
'primary' => false,
'notnull' => true,
'autoincrement' => false,
));
Which is taken straight from the output of generateModelsFromDb().
And finally my setUp() looks like:
public function setUp()
{
parent::setUp();
$this->actAs('Timestampable', array(
'created' => array(
'name' => 'created_at',
'type' => 'timestamp',
'format' => 'Y-m-d H:i:s',
'disabled' => false,
'options' => array()
),
'updated' => array(
'disabled' => true
)));
}
(I've tried not defining all of those fields for 'created', but I get the same problem.)
I'm a bit stumped as to what I'm doing wrong - for one thing I can't see why Doctrine would be running any unsigned checks against a 'timestamp' datatype...
Any help gratefully received!
Alex