增加自动迁移数据表代码

This commit is contained in:
RockYang
2025-04-29 22:55:30 +08:00
parent d1c9fd6eba
commit 8a2d2f66b5
89 changed files with 484 additions and 406 deletions

View File

@@ -1,7 +1,11 @@
package model
type Config struct {
Id uint `gorm:"primarykey;column:id"`
Key string `gorm:"column:marker;unique"`
Config string `gorm:"column:config_json"`
Id uint `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
Key string `gorm:"column:marker;type:varchar(20);uniqueIndex;not null;comment:标识" json:"marker"`
Config string `gorm:"column:config_json;type:text;not null" json:"config_json"`
}
func (m *Config) TableName() string {
return "chatgpt_configs"
}