| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package tables
-
- import (
- "time"
-
- "git.x2erp.com/qdy/go-db/sqldef"
- )
-
- func init() {
- sqldef.AddRegistration(func(r *sqldef.Registry) {
- tb := sqldef.NewTable("config_project_skill", "配置项目Skill表").
- ID("id", 128).NotNull().Comment("主键").End().
- String("skill_id", 128).NotNull().Comment("Skill ID").End().
- String("description", 256).NotNull().Default("''").Comment("描述").End().
- Text("content").NotNull().Comment("Skill内容 (mdN格式)").End().
- String("project_id", 128).NotNull().Comment("项目ID").End().
- String("creator", 32).NotNull().Comment("创建人").End().
- DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End()
-
- tb.AddIndex("idx_skill_id", "skill_id")
- tb.AddIndex("idx_project_id", "project_id")
-
- r.RegisterTable(tb.Build())
- })
- }
-
- type ProjectSkill struct {
- SkillID string `gorm:"column:skill_id;type:varchar(128);not null;primaryKey;comment:Skill ID"`
- Description string `gorm:"column:description;type:varchar(256);not null;default:'';comment:描述"`
- Content string `gorm:"column:content;type:json;not null;comment:Skill内容 (md格式)"`
- ProjectID string `gorm:"column:project_id;type:varchar(128);not null;comment:项目ID"`
- Creator string `gorm:"column:creator;type:varchar(32);not null;comment:创建人"`
- CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;comment:创建时间"`
- }
-
- type ProjectSkillDB struct {
- ID string `db:"id" json:"id"`
- SkillID string `db:"skill_id" json:"skillID"`
- Description string `db:"description" json:"description"`
- Content string `db:"content" json:"content"`
- ProjectID string `db:"project_id" json:"projectID"`
- Creator string `db:"creator" json:"creator"`
- CreatedAt time.Time `db:"created_at" json:"createdAt"`
- }
-
- func (ProjectSkill) TableName() string {
- return "config_project_skill"
- }
|