From 701ebcb11196e2ea9c368faaa72e7f3e3933749d Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Wed, 13 Apr 2022 03:36:41 +0200 Subject: [PATCH] test comments on columns with MySQL/MariaDB too remove PostgreSQL specific parts --- integrations/engine_test.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/integrations/engine_test.go b/integrations/engine_test.go index cdcdd6be..c49d3f95 100644 --- a/integrations/engine_test.go +++ b/integrations/engine_test.go @@ -255,23 +255,21 @@ func TestDBVersion(t *testing.T) { fmt.Println(testEngine.Dialect().URI().DBType, "version is", version) } -func TestGetColumns(t *testing.T) { - if testEngine.Dialect().URI().DBType != schemas.POSTGRES { +func TestGetColumnsComment(t *testing.T) { + switch testEngine.Dialect().URI().DBType { + case schemas.POSTGRES, schemas.MYSQL: + default: t.Skip() return } + comment := "this is a comment" type TestCommentStruct struct { - HasComment int + HasComment int `xorm:"comment('this is a comment')"` NoComment int } assertSync(t, new(TestCommentStruct)) - comment := "this is a comment" - sql := fmt.Sprintf("comment on column %s.%s is '%s'", testEngine.TableName(new(TestCommentStruct), true), "has_comment", comment) - _, err := testEngine.Exec(sql) - assert.NoError(t, err) - tables, err := testEngine.DBMetas() assert.NoError(t, err) tableName := testEngine.GetColumnMapper().Obj2Table("TestCommentStruct")