Initial commit: TaskPool React panel
- React frontend with route-level code splitting - Backend rebranded from Baihu to TaskPool - DB brand migration script and local compatibility
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
// BigText 自定义大数据文本类型,自动处理跨数据库类型差异
|
||||
// MySQL: LONGTEXT (4GB)
|
||||
// PostgreSQL: TEXT
|
||||
// SQLite: TEXT
|
||||
type BigText string
|
||||
|
||||
func (BigText) GormDBDataType(db *gorm.DB, field *schema.Field) string {
|
||||
switch db.Dialector.Name() {
|
||||
case "mysql":
|
||||
return "LONGTEXT"
|
||||
case "postgres":
|
||||
return "TEXT"
|
||||
case "sqlite":
|
||||
return "TEXT"
|
||||
}
|
||||
return "TEXT"
|
||||
}
|
||||
Reference in New Issue
Block a user