Fix migration
This commit is contained in:
parent
89921f68e5
commit
fbe62ed380
|
@ -22,7 +22,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type users20210713213622 struct {
|
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:"-"`
|
IsActive bool `xorm:"null" json:"-"`
|
||||||
Status int `xorm:"default 0" json:"-"`
|
Status int `xorm:"default 0" json:"-"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type tasks20210725153703 struct {
|
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"`
|
Position float64 `xorm:"double null" json:"position"`
|
||||||
KanbanPosition float64 `xorm:"double null" json:"kanban_position"`
|
KanbanPosition float64 `xorm:"double null" json:"kanban_position"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type lists20210727204942 struct {
|
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"`
|
Position float64 `xorm:"double null" json:"position"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type buckets20210727211037 struct {
|
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"`
|
Position float64 `xorm:"double null" json:"position"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type users20210802081716 struct {
|
type users20210802081716 struct {
|
||||||
DeletionScheduledAt time.Time `xorm:"null" json:"-"`
|
DeletionScheduledAt time.Time `xorm:"datetime null" json:"-"`
|
||||||
DeletionLastReminderSent time.Time `xorm:"null" json:"-"`
|
DeletionLastReminderSent time.Time `xorm:"datetime null" json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (users20210802081716) TableName() string {
|
func (users20210802081716) TableName() string {
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
package user
|
package user
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
"code.vikunja.io/api/pkg/notifications"
|
"code.vikunja.io/api/pkg/notifications"
|
||||||
|
|
||||||
"xorm.io/xorm"
|
"xorm.io/xorm"
|
||||||
|
@ -52,7 +54,9 @@ func ConfirmDeletion(s *xorm.Session, user *User, token string) (err error) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Schedule deletion
|
user.DeletionScheduledAt = time.Now()
|
||||||
|
_, err = s.Where("id = ?", user.ID).
|
||||||
|
Cols("deletion_scheduled_at").
|
||||||
|
Update(user)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,8 +95,8 @@ type User struct {
|
||||||
DefaultListID int64 `xorm:"bigint null index" json:"-"`
|
DefaultListID int64 `xorm:"bigint null index" json:"-"`
|
||||||
WeekStart int `xorm:"null" json:"-"`
|
WeekStart int `xorm:"null" json:"-"`
|
||||||
|
|
||||||
DeletionScheduledAt time.Time `xorm:"null" json:"-"`
|
DeletionScheduledAt time.Time `xorm:"datetime null" json:"-"`
|
||||||
DeletionLastReminderSent time.Time `xorm:"null" json:"-"`
|
DeletionLastReminderSent time.Time `xorm:"datetime null" json:"-"`
|
||||||
|
|
||||||
// A timestamp when this task was created. You cannot change this value.
|
// A timestamp when this task was created. You cannot change this value.
|
||||||
Created time.Time `xorm:"created not null" json:"created"`
|
Created time.Time `xorm:"created not null" json:"created"`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user