mysql日期字段默认值是CURRENT_TIMESTAMP, 导出创表sql会变为'CURRENT_TIMESTAMP' #1391

Closed
opened 2019-08-14 10:05:02 +00:00 by Jrohy · 1 comment
Jrohy commented 2019-08-14 10:05:02 +00:00 (Migrated from github.com)

调用engine.DumpAllToFile("1.sql") 导出的sql, 当表结构日期默认值为CURRENT_TIMESTAMP, 导出的sql 会变为字符串类型'CURRENT_TIMESTAMP'值,导致用engine.ImportFile("1.sql")会无法导入

正常的创表语句:
微信截图_20190814175709

DumpAllToFile导出的有问题sql:
微信截图_20190814175855

CURRENT_TIMESTAMP

调用`engine.DumpAllToFile("1.sql")` 导出的sql, 当表结构日期默认值为CURRENT_TIMESTAMP, 导出的sql 会变为字符串类型'CURRENT_TIMESTAMP'值,导致用`engine.ImportFile("1.sql")`会无法导入 正常的创表语句: <img width="432" alt="微信截图_20190814175709" src="https://user-images.githubusercontent.com/12463263/63012562-0b592a00-bebd-11e9-8717-99dede2abd75.png"> DumpAllToFile导出的有问题sql: <img width="461" alt="微信截图_20190814175855" src="https://user-images.githubusercontent.com/12463263/63012702-452a3080-bebd-11e9-8d5b-bd5ad9817b8b.png"> `CURRENT_TIMESTAMP`
lunny added the
kind
bug
label 2021-06-12 09:30:51 +00:00

This has been resolved.

This has been resolved.
lunny closed this issue 2021-06-12 09:39:52 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 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#1391
No description provided.