tag missing on reverse #46

Open
opened 2018-12-20 09:07:03 +00:00 by lunny · 0 comments
Owner

Author: @Nanyan

For the columns as follow in MySql :

`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

the reverse tool will generate fields as follow:

CreateTime        time.Time `xorm:"not null default 'CURRENT_TIMESTAMP' TIMESTAMP"`
UpdateTime        time.Time `xorm:"not null default 'CURRENT_TIMESTAMP' TIMESTAMP"`

In this case, CreateTime and UpdateTime fields will not have a correct behavior when user leave it unset (that is, it's value is zero.).

Does this problem is because of missing tag like created, updated when reverse?

Author: @Nanyan For the columns as follow in MySql : ``` `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, ``` the reverse tool will generate fields as follow: ``` CreateTime time.Time `xorm:"not null default 'CURRENT_TIMESTAMP' TIMESTAMP"` UpdateTime time.Time `xorm:"not null default 'CURRENT_TIMESTAMP' TIMESTAMP"` ``` In this case, CreateTime and UpdateTime fields will not have a correct behavior when user leave it unset (that is, it's value is zero.). Does this problem is because of missing tag like `created`, `updated` when reverse?
This repo is archived. You cannot comment on issues.
No Milestone
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/cmd#46
No description provided.