Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6ca88d16
authored
Sep 29, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(models): increase varchar length for TaskID and Username fields #1905
parent
d96f1b2a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
model/task.go
+1
-1
model/user.go
+1
-1
No files found.
model/task.go
View file @
6ca88d16
...
@@ -24,7 +24,7 @@ type Task struct {
...
@@ -24,7 +24,7 @@ type Task struct {
ID
int64
`json:"id" gorm:"primary_key;AUTO_INCREMENT"`
ID
int64
`json:"id" gorm:"primary_key;AUTO_INCREMENT"`
CreatedAt
int64
`json:"created_at" gorm:"index"`
CreatedAt
int64
`json:"created_at" gorm:"index"`
UpdatedAt
int64
`json:"updated_at"`
UpdatedAt
int64
`json:"updated_at"`
TaskID
string
`json:"task_id" gorm:"type:varchar(
50);index"`
// 第三方id,不一定有/ song id\ Task id
TaskID
string
`json:"task_id" gorm:"type:varchar(
191);index"`
// 第三方id,不一定有/ song id\ Task id
Platform
constant
.
TaskPlatform
`json:"platform" gorm:"type:varchar(30);index"`
// 平台
Platform
constant
.
TaskPlatform
`json:"platform" gorm:"type:varchar(30);index"`
// 平台
UserId
int
`json:"user_id" gorm:"index"`
UserId
int
`json:"user_id" gorm:"index"`
ChannelId
int
`json:"channel_id" gorm:"index"`
ChannelId
int
`json:"channel_id" gorm:"index"`
...
...
model/user.go
View file @
6ca88d16
...
@@ -18,7 +18,7 @@ import (
...
@@ -18,7 +18,7 @@ import (
// Otherwise, the sensitive information will be saved on local storage in plain text!
// Otherwise, the sensitive information will be saved on local storage in plain text!
type
User
struct
{
type
User
struct
{
Id
int
`json:"id"`
Id
int
`json:"id"`
Username
string
`json:"username" gorm:"unique;index" validate:"max=
12
"`
Username
string
`json:"username" gorm:"unique;index" validate:"max=
20
"`
Password
string
`json:"password" gorm:"not null;" validate:"min=8,max=20"`
Password
string
`json:"password" gorm:"not null;" validate:"min=8,max=20"`
OriginalPassword
string
`json:"original_password" gorm:"-:all"`
// this field is only for Password change verification, don't save it to database!
OriginalPassword
string
`json:"original_password" gorm:"-:all"`
// this field is only for Password change verification, don't save it to database!
DisplayName
string
`json:"display_name" gorm:"index" validate:"max=20"`
DisplayName
string
`json:"display_name" gorm:"index" validate:"max=20"`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment