Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

tag missing on reverse #46

Open
Nanyan opened this issue Dec 20, 2018 · 0 comments
Open

tag missing on reverse #46

Nanyan opened this issue Dec 20, 2018 · 0 comments

Comments

@Nanyan
Copy link

Nanyan commented Dec 20, 2018

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant