Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

config_project_skill.go 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package tables
  2. import (
  3. "time"
  4. "git.x2erp.com/qdy/go-db/sqldef"
  5. )
  6. func init() {
  7. sqldef.AddRegistration(func(r *sqldef.Registry) {
  8. tb := sqldef.NewTable("config_project_skill", "配置项目Skill表").
  9. ID("id", 128).NotNull().Comment("主键").End().
  10. String("skill_id", 128).NotNull().Comment("Skill ID").End().
  11. String("description", 256).NotNull().Default("''").Comment("描述").End().
  12. Text("content").NotNull().Comment("Skill内容 (mdN格式)").End().
  13. String("project_id", 128).NotNull().Comment("项目ID").End().
  14. String("creator", 32).NotNull().Comment("创建人").End().
  15. DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End()
  16. tb.AddIndex("idx_skill_id", "skill_id")
  17. tb.AddIndex("idx_project_id", "project_id")
  18. r.RegisterTable(tb.Build())
  19. })
  20. }
  21. type ProjectSkill struct {
  22. SkillID string `gorm:"column:skill_id;type:varchar(128);not null;primaryKey;comment:Skill ID"`
  23. Description string `gorm:"column:description;type:varchar(256);not null;default:'';comment:描述"`
  24. Content string `gorm:"column:content;type:json;not null;comment:Skill内容 (md格式)"`
  25. ProjectID string `gorm:"column:project_id;type:varchar(128);not null;comment:项目ID"`
  26. Creator string `gorm:"column:creator;type:varchar(32);not null;comment:创建人"`
  27. CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;comment:创建时间"`
  28. }
  29. type ProjectSkillDB struct {
  30. ID string `db:"id" json:"id"`
  31. SkillID string `db:"skill_id" json:"skillID"`
  32. Description string `db:"description" json:"description"`
  33. Content string `db:"content" json:"content"`
  34. ProjectID string `db:"project_id" json:"projectID"`
  35. Creator string `db:"creator" json:"creator"`
  36. CreatedAt time.Time `db:"created_at" json:"createdAt"`
  37. }
  38. func (ProjectSkill) TableName() string {
  39. return "config_project_skill"
  40. }