From c721a198a7ae3b9d68d3aed38d9d7d5bc55f3084 Mon Sep 17 00:00:00 2001 From: haoc7 Date: Sun, 10 Mar 2019 20:01:57 +0800 Subject: [PATCH] create table add column comment (#2298) --- dialect.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dialect.go b/dialect.go index 27b308af..cdc4278e 100644 --- a/dialect.go +++ b/dialect.go @@ -126,6 +126,10 @@ var ParseFieldStructForDialect = func(field *StructField, dialect Dialect) (fiel additionalType = additionalType + " DEFAULT " + value } + if value, ok := field.TagSettingsGet("COMMENT"); ok { + additionalType = additionalType + " COMMENT " + value + } + return fieldValue, dataType, size, strings.TrimSpace(additionalType) }