Fix migration to add position to task

Signed-off-by: kolaente <k@knt.li>
This commit is contained in:
kolaente 2020-06-07 18:28:49 +02:00
parent 8ef2da8f5f
commit 32a5dff78d
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -17,13 +17,13 @@
package migration package migration
import ( import (
"code.vikunja.io/api/pkg/models"
"math" "math"
"src.techknowlogick.com/xormigrate" "src.techknowlogick.com/xormigrate"
"xorm.io/xorm" "xorm.io/xorm"
) )
type task20200420215928 struct { type task20200420215928 struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"listtask"`
Position float64 `xorm:"double null" json:"position"` Position float64 `xorm:"double null" json:"position"`
} }
@ -42,7 +42,7 @@ func init() {
} }
// Create a position according to their id -> gives a starting position // Create a position according to their id -> gives a starting position
tasks := []*models.Task{} tasks := []*task20200420215928{}
err = tx.Find(&tasks) err = tx.Find(&tasks)
if err != nil { if err != nil {
return err return err