时间类型字段自动创建或者更新支持毫秒 #1867

Closed
opened 2021-02-12 02:47:43 +00:00 by roger777luo · 3 comments

image
支持格式化话携带毫秒

![image](/attachments/402d18bc-6235-4b88-8095-2ad8c1bdf600) 支持格式化话携带毫秒
lunny added the
kind
proposal
label 2021-06-12 07:27:39 +00:00

+1,这个在每秒写入数据很多时有用。

mysql 可以用DATETIME(3)

  `created_at` DATETIME(3) DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',

reverse 后

	CreatedAt  time.Time `xorm:"created"`
+1,这个在每秒写入数据很多时有用。 mysql 可以用`DATETIME(3)` ``` `created_at` DATETIME(3) DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间', ``` reverse 后 ``` CreatedAt time.Time `xorm:"created"` ```
Owner

We should have a new tag to indicate this column have a datetime with millisecond. If DATETIME(3) is expected which is different from Datetime, it's good to me. But for other database, we also have timestampz. Or we can support both.

We should have a new tag to indicate this column have a datetime with `millisecond`. If `DATETIME(3)` is expected which is different from `Datetime`, it's good to me. But for other database, we also have `timestampz`. Or we can support both.

PostgreSQL also has TIMESTAMP(n)

PostgreSQL also has `TIMESTAMP(n)`
lunny added this to the 1.2.1 milestone 2021-08-04 08:11:35 +00:00
lunny closed this issue 2021-08-04 08:12:12 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
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/xorm#1867
No description provided.