21 lines
593 B
Go
21 lines
593 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// SqlFile SQL 文件记录
|
|
type SqlFile struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Name string `gorm:"type:varchar(200);not null" json:"name"` // 文件名
|
|
Path string `gorm:"type:varchar(500);not null;uniqueIndex" json:"path"` // 文件路径
|
|
Content string `gorm:"type:text" json:"content"` // 文件内容
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// TableName 指定表名
|
|
func (SqlFile) TableName() string {
|
|
return "sql_file"
|
|
}
|