Expose migrate to

This commit is contained in:
kolaente 2020-06-21 14:15:14 +02:00
parent 1f731f77ef
commit 29efc3df4c
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 9 additions and 0 deletions

View File

@ -104,6 +104,15 @@ func Rollback(migrationID string) {
log.Info("Rolled back successfully.")
}
// MigrateTo executes all migrations up to a certain point
func MigrateTo(migrationID string, x *xorm.Engine) error {
m := initMigration(x)
if err := m.MigrateTo(migrationID); err != nil {
return err
}
return nil
}
// Deletes a column from a table. All arguments are strings, to let them be standalone and not depending on any struct.
func dropTableColum(x *xorm.Engine, tableName, col string) error {