WIP: Add dropTableCols from gitea (dropTableColumns at migrations.go) #1523
|
@ -28,6 +28,7 @@ type Interface interface {
|
|||
Delete(interface{}) (int64, error)
|
||||
Distinct(columns ...string) *Session
|
||||
DropIndexes(bean interface{}) error
|
||||
DropTableCols(bean interface{}, cols ...string) error
|
||||
Exec(sqlOrArgs ...interface{}) (sql.Result, error)
|
||||
Exist(bean ...interface{}) (bool, error)
|
||||
Find(interface{}, ...interface{}) error
|
||||
|
|
|
@ -345,3 +345,17 @@ func TestSync2_Default(t *testing.T) {
|
|||
assertSync(t, 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
Block a user