php - CakePHP 1.3 - create() not setting created datetime? -
i'm upgrading system cakephp 1.1 1.3. when using create() (followed save()) in 1.1 system happily add insert entry database created , modified datetime fields set of time created. however, in 1.3 no longer correctly happening. here modified still set current time upon creation , save, created datetime not being set. suggestions why might occurring? thanks!
create table code (as requested in comment):
create table `units` ( `id` int(10) unsigned not null auto_increment, `id_b36` varchar(4) null default null, `subject_id` int(10) unsigned not null, `gradelevel_id` int(10) unsigned not null, `user_id` int(10) unsigned not null, `school_id` int(10) null default null, `district_id` int(10) null default null, `description` varchar(255) not null, `sort` float(5,1) not null default '0.0', `created` datetime not null default '0000-00-00 00:00:00', `modified` datetime not null default '0000-00-00 00:00:00', primary key (`id`), index `subject_id` (`subject_id`), index `gradelevel_id` (`gradelevel_id`), index `sort` (`sort`), index `school_id` (`school_id`, `district_id`) ) collate='latin1_swedish_ci' engine=innodb row_format=default auto_increment=483
i should note 1 of tables, same thing occurs on other models. thanks!
created default null
cakephp populate created
if defined null:
by defining created and/or modified field in database table datetime fields (default null), cakephp recognize fields , populate them automatically whenever record created ...
Comments
Post a Comment