using default 0, solves this problem, but you need to insert a 0 to get the desired result of a created at timestamp.
create table example(
id int not null auto_increment,
code varchar(250),
created_at TIMESTAMP default 0,
modified_at TIMESTAMP on update current_timestamp,
primary key(id)
) engine innodb;
Rails has some timestamping conventions/methods of its own, but i think this kind of intelligence should reside within the database, not in a web framework.
Geen opmerkingen:
Een reactie posten