Fix #539 Reviewed-on: https://gitea.com/xorm/xorm/pulls/1937 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
2b78150f70
commit
9c0901bd35
|
@ -474,6 +474,25 @@ func TestSync2_Default(t *testing.T) {
|
|||
assert.NoError(t, testEngine.Sync2(new(TestSync2Default)))
|
||||
}
|
||||
|
||||
func TestSync2_Default2(t *testing.T) {
|
||||
type TestSync2Default2 struct {
|
||||
Id int64
|
||||
UserId int64 `xorm:"default(1)"`
|
||||
IsMember bool `xorm:"default(true)"`
|
||||
Name string `xorm:"default('')"`
|
||||
}
|
||||
|
||||
assert.NoError(t, PrepareEngine())
|
||||
assertSync(t, new(TestSync2Default2))
|
||||
assert.NoError(t, testEngine.Sync2(new(TestSync2Default2)))
|
||||
assert.NoError(t, testEngine.Sync2(new(TestSync2Default2)))
|
||||
assert.NoError(t, testEngine.Sync2(new(TestSync2Default2)))
|
||||
|
||||
assert.NoError(t, testEngine.Sync(new(TestSync2Default2)))
|
||||
assert.NoError(t, testEngine.Sync(new(TestSync2Default2)))
|
||||
assert.NoError(t, testEngine.Sync(new(TestSync2Default2)))
|
||||
}
|
||||
|
||||
func TestModifyColum(t *testing.T) {
|
||||
// Since SQLITE don't support modify column SQL, currrently just ignore
|
||||
if testEngine.Dialect().URI().DBType == schemas.SQLITE {
|
||||
|
|
Loading…
Reference in New Issue