From 483eee9b6b8b93930e0271bbfa7ba0275c932f2f Mon Sep 17 00:00:00 2001 From: qqxhb <1252905006@qq.com> Date: Wed, 15 Dec 2021 13:28:56 +0800 Subject: [PATCH] feat: ColumnType interface --- migrator.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/migrator.go b/migrator.go index 2a8b4254..1f2466ed 100644 --- a/migrator.go +++ b/migrator.go @@ -35,10 +35,24 @@ type ViewOption struct { type ColumnType interface { Name() string - DatabaseTypeName() string + DatabaseTypeName() string //varchar Length() (length int64, ok bool) DecimalSize() (precision int64, scale int64, ok bool) Nullable() (nullable bool, ok bool) + Comment() string + ColumnType() string //varchar(64) + GoTypeName() string //string + Primary() bool + AutoIncrement() bool + Default() string + Indexes() []IndexType //或者migrate加一个接口查询index,把columnName带上 +} + +type IndexType interface { + Name() string + Primary() bool + Unique() bool + Seq() int } type Migrator interface {