Reverted
continuous-integration/drone/push Build is failing Details

This commit is contained in:
konrad 2019-03-27 20:18:21 +01:00
parent 3b138190eb
commit acf9e4ccfc
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 1 additions and 13 deletions

View File

@ -17,16 +17,13 @@
package migration
import (
"bytes"
"code.vikunja.io/api/pkg/db"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/models"
"github.com/go-xorm/core"
"github.com/go-xorm/xorm"
"github.com/spf13/viper"
"sort"
"src.techknowlogick.com/xormigrate"
"strings"
)
// You can get the id string for new migrations by running `date +%Y%m%d%H%M%S` on a unix system.
@ -44,15 +41,6 @@ func Migrate(x *xorm.Engine) {
}
}
info := x.TableInfo(models.ListTask{}).Table
buf := &bytes.Buffer{}
err := x.DumpTables([]*core.Table{info}, buf, core.SQLITE)
colToRemove := "reminders_unix"
dump := buf.String()
dumpremoved := strings.ReplaceAll(dump, "`"+colToRemove+"` TEXT NULL, ", "")
dumpremoved = strings.ReplaceAll(dumpremoved, "`"+colToRemove+"` TEXT NULL, ", "")
// (, )?`updated`([A-Z ])*,?
// Because init() does not guarantee the order in which these are added to the slice,
// we need to sort them to ensure that they are in order
sort.Slice(migrations, func(i, j int) bool {
@ -62,7 +50,7 @@ func Migrate(x *xorm.Engine) {
m := xormigrate.New(x, migrations)
m.NewLogger(log.GetLogWriter("database"))
m.InitSchema(initSchema)
err = m.Migrate()
err := m.Migrate()
if err != nil {
log.Log.Criticalf("Migration failed: %v", err)
}