wip test
This commit is contained in:
parent
56bdd86430
commit
7fa36ef479
|
@ -28,6 +28,7 @@ type Interface interface {
|
||||||
Delete(interface{}) (int64, error)
|
Delete(interface{}) (int64, error)
|
||||||
Distinct(columns ...string) *Session
|
Distinct(columns ...string) *Session
|
||||||
DropIndexes(bean interface{}) error
|
DropIndexes(bean interface{}) error
|
||||||
|
DropTableCols(bean interface{}, cols ...string) error
|
||||||
Exec(sqlOrArgs ...interface{}) (sql.Result, error)
|
Exec(sqlOrArgs ...interface{}) (sql.Result, error)
|
||||||
Exist(bean ...interface{}) (bool, error)
|
Exist(bean ...interface{}) (bool, error)
|
||||||
Find(interface{}, ...interface{}) error
|
Find(interface{}, ...interface{}) error
|
||||||
|
|
|
@ -345,3 +345,17 @@ func TestSync2_Default(t *testing.T) {
|
||||||
assertSync(t, new(TestSync2Default))
|
assertSync(t, new(TestSync2Default))
|
||||||
assert.NoError(t, testEngine.Sync2(new(TestSync2Default)))
|
assert.NoError(t, testEngine.Sync2(new(TestSync2Default)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDropTableCols(t *testing.T) {
|
||||||
|
type TestDropTableCols struct {
|
||||||
|
Id int64
|
||||||
|
UserId int64 `xorm:"default(1)"`
|
||||||
|
ToDrop bool `xorm:"default(true)"`
|
||||||
|
Name string `xorm:"default('my_name')"`
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.NoError(t, prepareEngine())
|
||||||
|
assert.NoError(t, testEngine.Sync2(new(TestDropTableCols)))
|
||||||
|
assert.NoError(t, testEngine.DropTableCols(new(TestDropTableCols),"name", "to_drop"))
|
||||||
|
//ToDo: TEST if cols still exist
|
||||||
|
}
|
Loading…
Reference in New Issue