Skip to content

Commit 5acf66d

Browse files
authored
Merge pull request #52 from chengyumeng/hotfix/db_error
Hotfix/db error
2 parents b6923c4 + 9e31399 commit 5acf66d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/backend/models/notification.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ type Notification struct {
3131
Title string `orm:"size(2000)" json:"title,omitempty"`
3232
Message string `orm:"type(text)" json:"message,omitempty"`
3333
FromUser *User `orm:"index;rel(fk)" json:"from,omitempty"`
34-
Level NotificationLevel `orm:"int" json:"level,omitempty"`
35-
IsPublished bool `orm:"bool" json:"is_published"`
34+
Level NotificationLevel `orm:"default(0)" json:"level,omitempty"`
35+
IsPublished bool `orm:"default(false)" json:"is_published"`
3636
CreateTime *time.Time `orm:"auto_now_add;type(datetime)" json:"createTime,omitempty"`
3737
UpdateTime *time.Time `orm:"auto_now;type(datetime)" json:"updateTime,omitempty"`
3838
}

src/backend/models/notification_log.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ type notificationLogModel struct{}
1313

1414
type NotificationLog struct {
1515
Id int64 `orm:"auto" json:"id,omitempty"`
16-
UserId int64 `orm:"int" json:"user_id,omitempty"`
16+
UserId int64 `orm:"default(0)" json:"user_id,omitempty"`
1717
CreateTime *time.Time `orm:"auto_now_add;type(datetime)" json:"createTime,omitempty"`
18-
IsReaded bool `orm:"bool" json:"is_readed"`
18+
IsReaded bool `orm:"default(false)" json:"is_readed"`
1919
Notification *Notification `orm:"index;column(notification_id);rel(fk)" json:"notification"`
2020
}
2121

0 commit comments

Comments
 (0)