I'm new to CFWheels - started last week. I've managed to get a horse
sale admin site up and running just fine.
Something that's bothering me though: I can't get the Automatic Time
Stamps (
http://cfwheels.org/docs/1-1/chapter/automatic-time-stamps) or
Soft Deletes to work.
I've got fields called createdat and modifiedat and deletedat but I'm
not seeing them get updated on creation, update or delete.
I'm using MySQL.
Fields are set as datetime, Allow Null is set, and the default value =
NULL
In my controller, In my edit method, I am calling create()
<cfset horse = model("horse").create(params.horse)>
And in my update method, I am calling update()
<cfset horse.update(params.horse)>
So why am I not seeing the database fields update appropriately?
Here's the table definition:
CREATE TABLE `horses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`saleid` int(11) DEFAULT '0',
`name` varchar(60) DEFAULT '',
`sire` varchar(60) DEFAULT '',
`dam` varchar(60) DEFAULT '',
`sex` varchar(7) DEFAULT '',
`birthdate` date DEFAULT NULL,
`buyer` varchar(100) DEFAULT '',
`price` decimal(11,2) DEFAULT '0.00',
`createdat` datetime DEFAULT NULL,
`modifiedat` datetime DEFAULT NULL,
`deletedat` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `saleid` (`saleid`),
CONSTRAINT `saleid` FOREIGN KEY (`saleid`) REFERENCES `sales` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8
ROW_FORMAT=DYNAMIC;