test comments on columns with MySQL/MariaDB too
remove PostgreSQL specific parts
This commit is contained in:
parent
b3f9c53d8a
commit
701ebcb111
|
@ -255,23 +255,21 @@ func TestDBVersion(t *testing.T) {
|
||||||
fmt.Println(testEngine.Dialect().URI().DBType, "version is", version)
|
fmt.Println(testEngine.Dialect().URI().DBType, "version is", version)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetColumns(t *testing.T) {
|
func TestGetColumnsComment(t *testing.T) {
|
||||||
if testEngine.Dialect().URI().DBType != schemas.POSTGRES {
|
switch testEngine.Dialect().URI().DBType {
|
||||||
|
case schemas.POSTGRES, schemas.MYSQL:
|
||||||
|
default:
|
||||||
t.Skip()
|
t.Skip()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
comment := "this is a comment"
|
||||||
type TestCommentStruct struct {
|
type TestCommentStruct struct {
|
||||||
HasComment int
|
HasComment int `xorm:"comment('this is a comment')"`
|
||||||
NoComment int
|
NoComment int
|
||||||
}
|
}
|
||||||
|
|
||||||
assertSync(t, new(TestCommentStruct))
|
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()
|
tables, err := testEngine.DBMetas()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
tableName := testEngine.GetColumnMapper().Obj2Table("TestCommentStruct")
|
tableName := testEngine.GetColumnMapper().Obj2Table("TestCommentStruct")
|
||||||
|
|
Loading…
Reference in New Issue