mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-04 13:52:26 +08:00
fix: sqlite error
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,7 @@
|
||||
*.dylib
|
||||
*.DS_Store
|
||||
*.tar.gz
|
||||
*.db
|
||||
backend
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
appname: eiblog
|
||||
database:
|
||||
driver: postgres
|
||||
source: host=localhost port=5432 user=postgres dbname=eiblog sslmode=disable password=MTI3LjAuMC4x
|
||||
driver: sqlite
|
||||
source: ./eiblog.db
|
||||
eshost:
|
||||
eiblogapp:
|
||||
mode:
|
||||
|
||||
@@ -13,9 +13,9 @@ type Account struct {
|
||||
PhoneN string `gorm:"column:phone_n;not null" bson:"phone_n"` // 手机号
|
||||
Address string `gorm:"column:address;not null" bson:"address"` // 地址信息
|
||||
|
||||
LogoutAt time.Time `gorm:"column:logout_at;not null" bson:"logout_at"` // 登出时间
|
||||
LoginIP string `gorm:"column:login_ip;not null" bson:"login_ip"` // 最近登录IP
|
||||
LoginUA string `gorm:"column:login_ua;not null" bson:"login_ua"` // 最近登录IP
|
||||
LoginAt time.Time `gorm:"column:login_at;default:now()" bson:"login_at"` // 最近登录时间
|
||||
CreatedAt time.Time `gorm:"column:created_at;default:now()" bson:"created_at"` // 创建时间
|
||||
LogoutAt time.Time `gorm:"column:logout_at;not null" bson:"logout_at"` // 登出时间
|
||||
LoginIP string `gorm:"column:login_ip;not null" bson:"login_ip"` // 最近登录IP
|
||||
LoginUA string `gorm:"column:login_ua;not null" bson:"login_ua"` // 最近登录IP
|
||||
LoginAt time.Time `gorm:"column:login_at;default:current_timestamp" bson:"login_at"` // 最近登录时间
|
||||
CreatedAt time.Time `gorm:"column:created_at;default:current_timestamp" bson:"created_at"` // 创建时间
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ type Article struct {
|
||||
Tags pq.StringArray `gorm:"column:tags;type:text[]" bson:"tags"` // tags
|
||||
IsDraft bool `gorm:"column:is_draft;not null" bson:"is_draft"` // 是否是草稿
|
||||
|
||||
DeletedAt time.Time `gorm:"column:deleted_at;not null" bson:"deleted_at"` // 删除时间
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;default:now()" bson:"updated_at"` // 更新时间
|
||||
CreatedAt time.Time `gorm:"column:created_at;default:now()" bson:"created_at"` // 创建时间
|
||||
DeletedAt time.Time `gorm:"column:deleted_at;not null" bson:"deleted_at"` // 删除时间
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;default:current_timestamp" bson:"updated_at"` // 更新时间
|
||||
CreatedAt time.Time `gorm:"column:created_at;default:current_timestamp" bson:"created_at"` // 创建时间
|
||||
|
||||
Header string `gorm:"-" bson:"-"` // header
|
||||
Excerpt string `gorm:"-" bson:"-"` // 预览信息
|
||||
|
||||
@@ -5,11 +5,11 @@ import "time"
|
||||
|
||||
// Serie 专题
|
||||
type Serie struct {
|
||||
ID int `gorm:"column:id;primaryKey" bson:"id"` // 自增ID
|
||||
Slug string `gorm:"column:slug;not null;uniqueIndex" bson:"slug"` // 缩略名
|
||||
Name string `gorm:"column:name;not null" bson:"name"` // 专题名
|
||||
Desc string `gorm:"column:desc;not null" bson:"desc"` // 专题描述
|
||||
CreatedAt time.Time `gorm:"column:created_at;default:now()" bson:"created_at"` // 创建时间
|
||||
ID int `gorm:"column:id;primaryKey" bson:"id"` // 自增ID
|
||||
Slug string `gorm:"column:slug;not null;uniqueIndex" bson:"slug"` // 缩略名
|
||||
Name string `gorm:"column:name;not null" bson:"name"` // 专题名
|
||||
Desc string `gorm:"column:desc;not null" bson:"desc"` // 专题描述
|
||||
CreatedAt time.Time `gorm:"column:created_at;default:current_timestamp" bson:"created_at"` // 创建时间
|
||||
|
||||
Articles SortedArticles `gorm:"-" bson:"-"` // 专题下的文章
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user