22 lines
693 B
Go
22 lines
693 B
Go
package models
|
||
|
||
import (
|
||
"time"
|
||
)
|
||
|
||
// SqlTab SQL 编辑器标签页
|
||
type SqlTab struct {
|
||
ID uint `gorm:"primaryKey" json:"id"`
|
||
Title string `gorm:"type:varchar(100);not null" json:"title"` // 标签页标题
|
||
Content string `gorm:"type:text" json:"content"` // SQL 内容
|
||
ConnectionID *uint `gorm:"index" json:"connection_id"` // 关联的连接ID(可为空)
|
||
Order int `gorm:"default:0" json:"order"` // 排序顺序
|
||
CreatedAt time.Time `json:"created_at"`
|
||
UpdatedAt time.Time `json:"updated_at"`
|
||
}
|
||
|
||
// TableName 指定表名
|
||
func (SqlTab) TableName() string {
|
||
return "sql_tab"
|
||
}
|