Added bare migrations
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
kolaente 2019-03-25 08:05:06 +01:00
parent 1f17433f64
commit f04c597c11
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 84 additions and 57 deletions

View File

@ -15,3 +15,23 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package migration
import (
"github.com/go-xorm/xorm"
"src.techknowlogick.com/xormigrate"
)
func init() {
migrations = append(migrations, &xormigrate.Migration{
ID: "20190324205606",
Description: "Lorem Ipsum",
Migrate: func(tx *xorm.Engine) error {
return nil
},
Rollback: func(tx *xorm.Engine) error {
return nil
},
})
}

View File

@ -16,7 +16,10 @@
package migration
import "src.techknowlogick.com/xormigrate"
import (
"sort"
"src.techknowlogick.com/xormigrate"
)
// You can get the id string for new migrations by running `date +%Y%m%d%H%M%S` on a unix system.
@ -25,6 +28,9 @@ var migrations []*xormigrate.Migration
func Migrate() {
// 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 {
return migrations[i].ID < migrations[j].ID
})
/*
XORM logs from try.vikunja.io:
@ -77,11 +83,12 @@ func Migrate() {
Table users_namespace Column created db default is NULL, struct default is
Table users_namespace Column updated db default is NULL, struct default is
Table task_assignees Column created db default is NULL, struct default is
Table labels Column description db default is 'NULL', struct default is
Table labels Column description db default is 'NULL', struct default isdfdfsd
Table labels Column hex_color db default is 'NULL', struct default is
Table labels Column created db default is NULL, struct default is
Table labels Column updated db default is NULL, struct default is
Table label_task Column created db default is NULL, struct default is
Table tasks has column reminder_unix but struct has not related field
Table team_members has column updated but struct has not related field
*/