I have a table of the following structure in my mysql-db:
CREATE TABLE contract (
contract SERIAL,
user BIGINT UNSIGNED NOT NULL,
start DATE NOT NULL,
end DATE,
description VARCHAR(59),
changed TIMESTAMP DEFAULT now() ON UPDATE now(),
PRIMARY KEY (contract),
FOREIGN KEY (user) REFERENCES user (user)
ON DELETE RESTRICT
)
ENGINE = INNODB;
If I try to save a new record with an AR like this:
$ad = new ActionDump;
$ad->start = $dbStart;
$ad->end = $dbEnd;
$ad->action_type = $this->action_type->getDropDownList()->getDropDownList()->getSelectedValue();
$ad->contract = $contract;
$ad->save();
I get the follwing error:
TActiveRecordException
Description
Property 'ActionDump::$changed' must not be null as defined by column 'changed' in table '`action_dump`'.
So the question is: What's going wrong there? How can that issue be fixed?
Greetings acron
ps I *can* insert a record without setting the changed column using the mysql console or phpmyadmin...
pps the Contract-AR is generated by php-cli and not modified.