From 45bb547a81251563d3fb4d9d90ca46ac9a0a5dde Mon Sep 17 00:00:00 2001 From: anqiansong Date: Sat, 17 Jun 2023 21:23:57 +0800 Subject: [PATCH] (goctl)fix: #3328 (#3348) Co-authored-by: Kevin Wan --- tools/goctl/internal/version/version.go | 2 +- tools/goctl/model/sql/example/sql/user.sql | 1 + tools/goctl/model/sql/parser/testdata/user.sql | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/goctl/internal/version/version.go b/tools/goctl/internal/version/version.go index 103fe713..fe9f7afa 100644 --- a/tools/goctl/internal/version/version.go +++ b/tools/goctl/internal/version/version.go @@ -6,7 +6,7 @@ import ( ) // BuildVersion is the version of goctl. -const BuildVersion = "1.5.3" +const BuildVersion = "1.5.4" var tag = map[string]int{"pre-alpha": 0, "alpha": 1, "pre-bata": 2, "beta": 3, "released": 4, "": 5} diff --git a/tools/goctl/model/sql/example/sql/user.sql b/tools/goctl/model/sql/example/sql/user.sql index 8fac2a3c..9b1cc67a 100644 --- a/tools/goctl/model/sql/example/sql/user.sql +++ b/tools/goctl/model/sql/example/sql/user.sql @@ -30,5 +30,6 @@ CREATE TABLE `student` ) DEFAULT NULL, `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `update_time` timestamp NULL DEFAULT NULL, + `delete_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`type`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; \ No newline at end of file diff --git a/tools/goctl/model/sql/parser/testdata/user.sql b/tools/goctl/model/sql/parser/testdata/user.sql index 66749931..1113f7a1 100644 --- a/tools/goctl/model/sql/parser/testdata/user.sql +++ b/tools/goctl/model/sql/parser/testdata/user.sql @@ -7,6 +7,8 @@ CREATE TABLE `test_user` 名', `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP comment '创建\r时间', `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `delete_time` timestamp NULL DEFAULT NULL, + `delete_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `mobile_unique` (`mobile`), UNIQUE KEY `class_name_unique` (`class`,`name`),