Skip to content

Commit 2832f82

Browse files
committed
fix: db text type
1 parent b1e3bc1 commit 2832f82

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

internal/model/movie.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ type MovieBase struct {
6969
VendorInfo VendorInfo `gorm:"embedded;embeddedPrefix:vendor_info_" json:"vendorInfo,omitempty"`
7070
Headers map[string]string `gorm:"serializer:fastjson;type:text" json:"headers,omitempty"`
7171
Subtitles map[string]*Subtitle `gorm:"serializer:fastjson;type:text" json:"subtitles,omitempty"`
72-
URL string `gorm:"type:varchar(8192)" json:"url"`
73-
Name string `gorm:"not null;type:varchar(256)" json:"name"`
72+
URL string `gorm:"type:text" json:"url"`
73+
Name string `gorm:"not null;type:text" json:"name"`
7474
Type string `json:"type"`
7575
ParentID EmptyNullString `gorm:"type:char(32)" json:"parentId"`
7676
MoreSources []*MoreSource `gorm:"serializer:fastjson;type:text" json:"moreSources,omitempty"`
77-
Danmu string `gorm:"type:varchar(8192)" json:"danmu"`
78-
StreamDanmu string `gorm:"type:varchar(8192)" json:"streamDanmu"`
77+
Danmu string `gorm:"type:text" json:"danmu"`
78+
StreamDanmu string `gorm:"type:text" json:"streamDanmu"`
7979
Live bool `json:"live"`
8080
Proxy bool `json:"proxy"`
8181
RtmpSource bool `json:"rtmpSource"`
@@ -208,8 +208,8 @@ func (b *BilibiliStreamingInfo) Validate() error {
208208

209209
type AlistStreamingInfo struct {
210210
// {/}serverId/Path
211-
Path string `gorm:"type:varchar(4096)" json:"path,omitempty"`
212-
Password string `gorm:"type:varchar(256)" json:"password,omitempty"`
211+
Path string `gorm:"type:text" json:"path,omitempty"`
212+
Password string `gorm:"type:varchar(64)" json:"password,omitempty"`
213213
}
214214

215215
func GetAlistServerIDFromPath(path string) (serverID string, filePath string, err error) {

internal/model/user.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type User struct {
4343
CreatedAt time.Time
4444
UpdatedAt time.Time
4545
Username string `gorm:"not null;uniqueIndex;type:varchar(32)"`
46-
Email EmptyNullString `gorm:"type:varchar(128);uniqueIndex"`
46+
Email EmptyNullString `gorm:"type:varchar(64);uniqueIndex"`
4747
HashedPassword []byte `gorm:"not null"`
4848
BilibiliVendor *BilibiliVendor `gorm:"foreignKey:UserID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
4949
Movies []*Movie `gorm:"foreignKey:CreatorID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL"`

0 commit comments

Comments
 (0)