emm..., I'm a little bit sorry about this, now I realize this is quite complicated when considering different database.
When I have a field such as create_time timestamp default CURRENT_TIMESTAMP not null in MySQL Data table, then the tool xorm reverse will generate a field in struct as: CreateTime time.Time xorm:"not null default 'CURRENT_TIMESTAMP' TIMESTAMP" .
Before I commit this fix, when I leave CreateTime as default, then in db the create_time field will be as 0001-01-01 00:00:00, So I fix this problem. It works for MySQL database!
Now I realize that, it works ok for MySQL with the INSERT sql of "INSERT INTO tbname (..., create_time) VALUES (..., null);"; BUT at least it's NOT work for Sqlite3 (which is what the testEngine used).
That is, if the time field IsZero, then it's ok for formatColTime to return nil if the col has default value for MySQL, but is not ok for Sqlite3 (and I don't known what about the others database).
As above, I thought whether we should just omit the time field if it's zero and the table's field has default setting?
added this to the 1.0.0 milestone 3 years ago
modified the milestone from 1.0.0 to 1.1.12 years ago