From 4d1c98aa936365af520c3af17e816e732760f24a Mon Sep 17 00:00:00 2001 From: Jason Godsey Date: Wed, 24 Oct 2018 15:28:42 -0600 Subject: [PATCH 1/2] Support text column type (same as dialect_mysql) --- dialect_sqlite.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dialect_sqlite.go b/dialect_sqlite.go index 7d9b2975..882d0260 100644 --- a/dialect_sqlite.go +++ b/dialect_sqlite.go @@ -52,7 +52,13 @@ func (d SqliteDialect) ToSqlType(val reflect.Type, maxsize int, isAutoIncr bool) if maxsize < 1 { maxsize = 255 } - return fmt.Sprintf("varchar(%d)", maxsize) + + if maxsize < 256 { + return fmt.Sprintf("varchar(%d)", maxsize) + } else { + return "text" + } + } // Returns autoincrement From 5d4015889383f93399ad286104657a20345cc6ca Mon Sep 17 00:00:00 2001 From: Jason Godsey Date: Wed, 24 Oct 2018 16:24:28 -0600 Subject: [PATCH 2/2] Removed excess tab --- dialect_sqlite.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialect_sqlite.go b/dialect_sqlite.go index 882d0260..911d0d93 100644 --- a/dialect_sqlite.go +++ b/dialect_sqlite.go @@ -52,7 +52,7 @@ func (d SqliteDialect) ToSqlType(val reflect.Type, maxsize int, isAutoIncr bool) if maxsize < 1 { maxsize = 255 } - + if maxsize < 256 { return fmt.Sprintf("varchar(%d)", maxsize) } else {