Fix migration

This commit is contained in:
kolaente 2021-08-02 08:27:38 +02:00
parent 89921f68e5
commit fbe62ed380
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
7 changed files with 14 additions and 10 deletions

View File

@ -22,7 +22,7 @@ import (
)
type users20210713213622 struct {
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"`
ID int64 `xorm:"bigint autoincr not null" json:"id"`
IsActive bool `xorm:"null" json:"-"`
Status int `xorm:"default 0" json:"-"`
}

View File

@ -24,7 +24,7 @@ import (
)
type tasks20210725153703 struct {
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"listtask"`
ID int64 `xorm:"bigint autoincr not null" json:"id" param:"listtask"`
Position float64 `xorm:"double null" json:"position"`
KanbanPosition float64 `xorm:"double null" json:"kanban_position"`
}

View File

@ -24,7 +24,7 @@ import (
)
type lists20210727204942 struct {
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"list"`
ID int64 `xorm:"bigint autoincr not null" json:"id" param:"list"`
Position float64 `xorm:"double null" json:"position"`
}

View File

@ -24,7 +24,7 @@ import (
)
type buckets20210727211037 struct {
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"list"`
ID int64 `xorm:"bigint autoincr not null" json:"id" param:"list"`
Position float64 `xorm:"double null" json:"position"`
}

View File

@ -23,8 +23,8 @@ import (
)
type users20210802081716 struct {
DeletionScheduledAt time.Time `xorm:"null" json:"-"`
DeletionLastReminderSent time.Time `xorm:"null" json:"-"`
DeletionScheduledAt time.Time `xorm:"datetime null" json:"-"`
DeletionLastReminderSent time.Time `xorm:"datetime null" json:"-"`
}
func (users20210802081716) TableName() string {

View File

@ -17,6 +17,8 @@
package user
import (
"time"
"code.vikunja.io/api/pkg/notifications"
"xorm.io/xorm"
@ -52,7 +54,9 @@ func ConfirmDeletion(s *xorm.Session, user *User, token string) (err error) {
return err
}
// TODO: Schedule deletion
user.DeletionScheduledAt = time.Now()
_, err = s.Where("id = ?", user.ID).
Cols("deletion_scheduled_at").
Update(user)
return nil
}

View File

@ -95,8 +95,8 @@ type User struct {
DefaultListID int64 `xorm:"bigint null index" json:"-"`
WeekStart int `xorm:"null" json:"-"`
DeletionScheduledAt time.Time `xorm:"null" json:"-"`
DeletionLastReminderSent time.Time `xorm:"null" json:"-"`
DeletionScheduledAt time.Time `xorm:"datetime null" json:"-"`
DeletionLastReminderSent time.Time `xorm:"datetime null" json:"-"`
// A timestamp when this task was created. You cannot change this value.
Created time.Time `xorm:"created not null" json:"created"`