fix:fix ci error 5
This commit is contained in:
parent
584f744a28
commit
d3caadc4a4
|
@ -752,21 +752,32 @@ func getKeysFromMap(m map[string]*schemas.Index) []string {
|
||||||
return ss
|
return ss
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSync2_3(t *testing.T) {
|
|
||||||
if testEngine.Dialect().URI().DBType == schemas.MYSQL {
|
type SyncTestUser struct {
|
||||||
type SyncTestUser struct {
|
|
||||||
Id int `xorm:"pk autoincr 'id'"`
|
Id int `xorm:"pk autoincr 'id'"`
|
||||||
Name string `xorm:"'name' notnull comment('nickname')" json:"name"`
|
Name string `xorm:"'name' notnull comment('nickname')" json:"name"`
|
||||||
}
|
}
|
||||||
assert.NoError(t, PrepareEngine())
|
|
||||||
assert.NoError(t, testEngine.Sync2(new(SyncTestUser)))
|
|
||||||
|
|
||||||
// add comment for id column
|
func (m *SyncTestUser) TableName() string {
|
||||||
type SyncTestUser2 struct {
|
return "sync_test_user"
|
||||||
|
}
|
||||||
|
|
||||||
|
// add comment for id column
|
||||||
|
type SyncTestUser2 struct {
|
||||||
Id int `xorm:"pk autoincr 'id' comment('primary key')"`
|
Id int `xorm:"pk autoincr 'id' comment('primary key')"`
|
||||||
Name string `xorm:"'name' notnull comment('nickname')" json:"name"`
|
Name string `xorm:"'name' notnull comment('nickname')" json:"name"`
|
||||||
}
|
}
|
||||||
assert.NoError(t, testEngine.Table("sync_test_user").Sync2(new(SyncTestUser2)))
|
|
||||||
|
func (m *SyncTestUser2) TableName() string {
|
||||||
|
return "sync_test_user"
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSync2_3(t *testing.T) {
|
||||||
|
if testEngine.Dialect().URI().DBType == schemas.MYSQL {
|
||||||
|
assert.NoError(t, PrepareEngine())
|
||||||
|
assertSync(t, new(SyncTestUser))
|
||||||
|
|
||||||
|
assert.NoError(t, testEngine.Sync2(new(SyncTestUser2)))
|
||||||
tables, err := testEngine.DBMetas()
|
tables, err := testEngine.DBMetas()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
tableInfo, err := testEngine.TableInfo(new(SyncTestUser2))
|
tableInfo, err := testEngine.TableInfo(new(SyncTestUser2))
|
||||||
|
|
Loading…
Reference in New Issue